-
ADO Runtime Problem
I'm brand spanking new to this and I can't seem to figure out why my datagridview won't populate from my dataset won't populate information.
This is a small test sub on a seperate class I have written, its very basic, and the datagridview is supplied on a seperate form. Just some information.
Here is my lil block o' code:
Code:
Sub test()
conCust.Open()
dsCust.Clear()
accCommand.CommandText = "SELECT * FROM Customers"
accCommand.Connection = conCust
daCust.SelectCommand = accCommand
Try
daCust.Fill(dsCust, "Customers")
frmMain.dvgFrmMain.DataSource = dsCust.Tables("Customers")
Catch ex As Exception
End Try
End Sub
I've also declared everyone within .Net public so I can move around for now. My public declarations are:
Code:
Public Class dvdClass
Public dsCust As New DataSet
Public conCust As New OleDbConnection(conString)
Public daCust As New OleDbDataAdapter
Public accCommand As New OleDbCommand
Const conString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=..\DvdRental.accdb;Persist Security Info=False;"
Anyone throw me a bone here? I'm sure I've messed up terminology a little bit but I've never worked ole, ADO, and at that never even attempted runtime connections.
-
Re: ADO Runtime Problem
Nm, solved it. Damn dirty table names!