becool20082008
Member
- Joined
- Sep 16, 2009
- Messages
- 5
- Programming Experience
- 1-3
hi i'm new to vb.net. i'm using visual studio 2005 windows application vb.net language. i'm doing a company project and using MS access database.
i want the user to add data about the new customer and save it to the database.i used the followinf code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dbconnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "data source=C:\Users\Haidar\Desktop\customer list\New Farahnet\FarahnetCustomers.mdb"
Dim dbcommand As String = "INSERT into customers (Fname, Lname, IP, Telephone, Email, Location, TypeocConnection, Download, Upload, StartDate, StoppedDate) " & " VALUES (Textbox1.text,Textbox2.text,Textbox3.text,Textbox4.text,Textbox5.text,Textbox6.text,Textbox7.text,Textbox8.text,Textbox9.text,Textbox10.text,Textbox11.text)"
Dim DataAdapterTest As New OleDb.OleDbDataAdapter(dbcommand, dbconnection)
Dim customersDataSet As New DataSet()
DataAdapterTest.Fill(customersDataSet)
Dim dtcustomers As DataTable = customersDataSet.Tables(0)
End Sub
but i get an error on the underlined line above.can anyone please tell me if there is anything wrong with it?
i want the user to add data about the new customer and save it to the database.i used the followinf code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dbconnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "data source=C:\Users\Haidar\Desktop\customer list\New Farahnet\FarahnetCustomers.mdb"
Dim dbcommand As String = "INSERT into customers (Fname, Lname, IP, Telephone, Email, Location, TypeocConnection, Download, Upload, StartDate, StoppedDate) " & " VALUES (Textbox1.text,Textbox2.text,Textbox3.text,Textbox4.text,Textbox5.text,Textbox6.text,Textbox7.text,Textbox8.text,Textbox9.text,Textbox10.text,Textbox11.text)"
Dim DataAdapterTest As New OleDb.OleDbDataAdapter(dbcommand, dbconnection)
Dim customersDataSet As New DataSet()
DataAdapterTest.Fill(customersDataSet)
Dim dtcustomers As DataTable = customersDataSet.Tables(0)
End Sub
but i get an error on the underlined line above.can anyone please tell me if there is anything wrong with it?