hisheeraz
Member
- Joined
- Oct 5, 2008
- Messages
- 11
- Programming Experience
- 1-3
Hello Friends
im having trouble loading data into database into the form
here is my code
im having error at the bold code...
the error is
Error 1 Class 'System.Data.DataSet' cannot be indexed because it has no default property. C:\Documents and Settings\§ RentedLips §\Desktop\VisualBasic2008\Db\Db\Form1.vb 21 24 Db
Please help me!
Thanks
hisheeraz
im having trouble loading data into database into the form
here is my code
VB.NET:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Oconn As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Application.StartupPath & "\dbn.mdb")
Oconn.Open()
sql = "select aname from tbln"
da = New OleDb.OleDbDataAdapter(sql, Oconn)
ds = New DataSet
da.Fill(ds, "tbln")
[B]txtname.Text = ds("aname")[/B]
End Sub
im having error at the bold code...
the error is
Error 1 Class 'System.Data.DataSet' cannot be indexed because it has no default property. C:\Documents and Settings\§ RentedLips §\Desktop\VisualBasic2008\Db\Db\Form1.vb 21 24 Db
Please help me!
Thanks
hisheeraz