
Visual Basic .NET and ADO.NET code - Disconnected Updating Help
All,
I am trying to do something I thought was easy, updating a datarow in Access
using the disconnect method. Here is an example of what I am using. For
example if I wanted to update field "ProductName" in row(0) with a differnt
value. How would I implement it in this code? I have tried differnt things
but it will not update.
Imports System.Data.OleDb
Sub Main()
Dim objConn As New OleDbConnection _
("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"User ID=Admin;" & _
"Data Source=C:\Program Files\Microsoft" & _
"Office\Office10\Samples\Northwind.mdb")
objConn.Open()
Dim objAdapter As New OleDbDataAdapter _
("SELECT * FROM Products", objConn)
Dim objDataSet As New DataSet()
objAdapter.Fill(objDataSet)
With objDataSet.Tables("Table").Rows(0)
Console.Write(.Item("ProductName") & ", " _
& .Item("UnitsInStock"))
End With
End Sub