tariqanis2001
asked on
Can't update database with SQL dataAdapter
Hi,
Being new to database programming, I am trying my hand at using code (as opposed to dragging the graphical componants to the form).
I have a simple database on SQL server 2005 express, connected to a Windows form. When trying to update changes I make to to the fields on the form using the sqldataAdapter update command the changes are not committed to the databse.
I use the following line of code to perform the update:
DataAdapterCustomers.Updat e(DataSetC ustomers)
The connection, dataAdapter and dataset were created using the following code:
-------------------------
Dim sConnectionString As String = _
"data source=TONI\SQLEXPRESS;" & "initial catalog=Murach;integrated security=SSPI;" & _
"persist security info=false;workstation id=TONI;packet size=4096"
Dim cnn As New SqlConnection(sConnectionS tring)
The Select statement
Dim sCustomersSelect = "Select * from Customers"
Dim DataAdapterCustomers As New SqlDataAdapter(sCustomersS elect, cnn)
Dim DataSetCustomers As New DataSet()
---------------
I think I need to configure my dataAdapter, but I have no idea how to do that in code. Please help.
Being new to database programming, I am trying my hand at using code (as opposed to dragging the graphical componants to the form).
I have a simple database on SQL server 2005 express, connected to a Windows form. When trying to update changes I make to to the fields on the form using the sqldataAdapter update command the changes are not committed to the databse.
I use the following line of code to perform the update:
DataAdapterCustomers.Updat
The connection, dataAdapter and dataset were created using the following code:
-------------------------
Dim sConnectionString As String = _
"data source=TONI\SQLEXPRESS;" & "initial catalog=Murach;integrated security=SSPI;" & _
"persist security info=false;workstation id=TONI;packet size=4096"
Dim cnn As New SqlConnection(sConnectionS
The Select statement
Dim sCustomersSelect = "Select * from Customers"
Dim DataAdapterCustomers As New SqlDataAdapter(sCustomersS
Dim DataSetCustomers As New DataSet()
---------------
I think I need to configure my dataAdapter, but I have no idea how to do that in code. Please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER