Hi,
Here is the example for inserting the data using Ado.net
Public sub InsertData()
Dim con as new oledb.Connection
Dim strcon as String
Dim com as new Oledb.Command
''connectionstring for connection to Pubs database
strcon = "Provider=SQLOLEDB.1;Persist Security Info=True;UserID=sa;password=;Initial Catalog=Pubs;Data Source=."
con.ConnectionString = strcon
'''Open the connection
con.open
''''''''Insert into database
''Take the values from textboxes
Dim ID as int
Dim strName as string
ID = Textbox1.text
strName = Textbox2.text
Sql = "Insert into tablename(ID,Name) values(" & ID & ",'" & strName & "')"
com.Connection = con
com.CommandType = Text
com.CommandText = Sql
com.ExecuteNonQuery()
con.close
End Sub
How to insert textbox data in sqlserver2000 in ado.net