Sorry I dont know c# but you can get the idea from this code.
I'll Assume you have textbox (txtFirst.txt txtlast.txt) controls on your apsx page and a
Button to submit and gridview or something to databind
Put this code inside your Button click event.
Replace with your own connection string from your web.config file
Replace strings with your own values
Replace Table1 with the name of your sql Table name
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim firstname, lastname As String
Try
con.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ToString
con.Open()
cmd.Connection = con
cmd.CommandText = "INSERT INTO Table1([FirstName], [LastName]) VALUES('" & firstname & "','" & lastname & "')"
cmd.ExecuteNonQuery()
Catch ex As Exception
Response.Write("Error while inserting record on table..." + ex.Message + "Insert Records")
Finally
con.Close()
End Try
DataBind()