Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I am having a problem with up

Status
Not open for further replies.

sribu

Programmer
Mar 8, 2003
17
US
Hi,
I am having a problem with updating the database from the dataset.My code executes fine and comes out of the procedure but i cannot see the changes in the database.Can anyone tell me where I am going wrong.
Here is my code:

Dim custDA As OleDbDataAdapter = New OleDbDataAdapter()
Dim custDS As DataSet = New DataSet()
Dim adoConn As ADODB.Connection = New ADODB.Connection()
Dim adoRS As ADODB.Recordset = New ADODB.Recordset()
Dim dte As DateTime
dte = dte.Now
Dim aryFields() As String = Split("Type,GUID,IsRunning,LastRun,Interval", ",")
Dim aryValues() As String = Split("DataFeed,hello,False,02/20/2003,1000", ",")
adoConn.Open("PROVIDER=MICROSOFT.JET.OLEDB.4.0;Data Source=c:\myDig\DigDemo.mdb;")
adoRS.Open("SELECT * FROM Scheduler", adoConn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockBatchOptimistic, 1)
custDA.Fill(custDS, adoRS, "Scheduler")
MessageBox.Show("OK")

Dim drCurrent As DataRow
drCurrent = custDS.Tables("Scheduler").NewRow()
drCurrent.Item("Type") = "DataFeed"

drCurrent.Item("GUID") = "hello"
drCurrent.Item("IsRunning") = False
drCurrent.Item("LastRun") = dte
drCurrent.Item("Interval") = 1000
'drCurrent.AcceptChanges()
custDS.Tables("scheduler").Rows.Add(drCurrent)
custDS.AcceptChanges()
custDA.Update(custDS, "Scheduler")
'MessageBox.Show(custDA.InsertCommand().CommandText().ToString())
MessageBox.Show("Done")
adoConn.Close()

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top