I'm trying to make a big leap here from Visual Basic 6 / Interdev 6 to Visual Studio 2005 .Net and I'm struggling because things have changed a lot!
I have developing a simple windows CE 5 application using Visual Studio. I have managed to create a SQL CE database on my mobile and create the dataset and table adaptor. In this code I am trying to insert a record into my local ce database and then loop through the database to read all the records in it. I'm getting an error on the "as DataRow" that "Type DataRow is not defined".
I'd appreciate any feedback on why the error and if I am doing this correctly.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim offlineClockData As New OnyxCEDataSet
Dim offlineTableAdaptor As New OnyxCEDataSetTableAdapters.tblOfflineClockDataTableAdapter
Dim vEID As String
offlineTableAdaptor.Insert(Now(), "977111", "117273", 1)
offlineTableAdaptor.Fill(offlineclockdata.tblOfflineClockData)
For Each objRow As DataRow In offlineClockData.tblOfflineClockData.Rows
vEID = objRow("EID")
Next
vEID = offlineclockdata.tblOfflineClockData.Rows(0).Item("EID")
End Sub
ASKER
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim offlineClockData As New OnyxCEDataSet
Dim offlineTableAdaptor As New OnyxCEDataSetTableAdapters
Dim vEID As String
Dim i As Long
offlineTableAdaptor.Insert
offlineTableAdaptor.Fill(o
For i = 0 To offlineClockData.tblOfflin
vEID = offlineClockData.tblOfflin
MsgBox("veid=" & vEID)
Next
End Sub
Does this look correct or is there a better way to do it? Also, do I need to "Close" the connections?