DataGridView and ADODB

willymac1507

New member
Joined
Nov 20, 2007
Messages
2
Programming Experience
1-3
I must be rubbish - I cannot get my DataGridView to populate with the contents of an ADODB dataset. So I tried a different tack, thought I'd use a parameterized query but can't work out how to assign the contents of a text box to the parameter. Can anyone help?

Basically, got an access database back end, and am connecting using an ADODB connection (works elsewhere in the app) to generate a recordset. I need to show this in a datagridview. The whole process is designed to show a set of records based on the text in a text box - ie if the user types an account number in the textbox and clicks the button, the datagrid will display all records attahced to that that account number. I am tearing my hair out here - please help!
 
are you using a typed dataSet? If so have you created a fill by query on your tableAdapter? this is your parameter query...

you set the DataGridView dataSource to be that of your DataSet TableAdapter...

Are you using the GUI or trying to attempt this all in code only?
 
It's all coded. I have been using the normal connection settings that I have used throughout the rest of the app, up until I open the recordset. I then tried DataGridView1.Fill(me.rs."TabCallLog") having specified the Data Source as rs (the recordset), but the DataGridView remains blank. Found loads of code online around OleDataObjects etc. but I would prefer to simply create the recordset using ADODB.Connection and fill the grid with this.:confused:
 
I must be rubbish - I cannot get my DataGridView to populate with the contents of an ADODB dataset. So I tried a different tack, thought I'd use a parameterized query but can't work out how to assign the contents of a text box to the parameter. Can anyone help?

Basically, got an access database back end, and am connecting using an ADODB connection (works elsewhere in the app) to generate a recordset. I need to show this in a datagridview. The whole process is designed to show a set of records based on the text in a text box - ie if the user types an account number in the textbox and clicks the button, the datagrid will display all records attahced to that that account number. I am tearing my hair out here - please help!

Read the DW2 link in my signature, section "Creating a Simple Data APp"
 
Back
Top