getting all values from a form and submitting them to a SQL server database

son

Regular
Joined
Feb 21, 2004
Messages
67
i am using vb.net language.

I am have a web form which has a datetimepicker , and two textboxes. i know this might sound stupied but i am really confused i guess more nervous but anyway.. can someone tell me how i can get all of these values and submit them to a table in an sql server database. what actually code do i add?

thanks in advance sonia.. :)
 
Dim cn As New SqlConnection("...connectionstring here...")

Dim qry as String="insert into table(field1,field2....) values('" & textbox1.text & "','" & textbox2.text & "','..........

Dim cm as New SqlCommand(qry,cn)
cn.Open()
cm.ExecuteNonQuery()
cn.Close()



I hope this helps
 
Back
Top