You can get a form value posted to a page using code similiar to this (C#) -
string formValue;
if (!string.IsNullOrEmpty(Request.Form["txtFormValue"]))
{
formValue= Request.Form["txtFormValue"];
}
or this (VB)
Dim formValue As String
If Not String.IsNullOrEmpty(Request.Form("txtFormValue")) Then
formValue = Request.Form("txtFormValue")
End If
Once you have the values you need you can then construct a SQL statement and and write the data to a database.