Having a problem with program saying there is nothing at row 0. I know there is but it says there is not. I am using SQL Server compact 3.5 sp1. I am following the HomeAndLearn Tutorial for access, so maybe the problem is that it is using access and I am using SQL Server CE?
Uploaded image of error
Code:Public Class Form1 Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click Dim con As New OleDb.OleDbConnection Dim ds As New DataSet Dim da As OleDb.OleDbDataAdapter Dim sql As String con.ConnectionString = "Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=|DataDirectory|\addressdb.sdf;" con.Open() MsgBox("A Connection to the Database is now open") sql = "SELECT * FROM AddressBookT" da = New OleDb.OleDbDataAdapter(sql, con) da.Fill(ds, "AddressBook") con.Close() MsgBox("The Connection to the Database is now Closed") txtFirstName.Text = ds.Tables("AddressBook").Rows(0).Item(1) End Sub





Reply With Quote