I've tried to bind a mySqlDataAdapter to a data grid view, but without much success (in C# Visual Studio Express 2005).
The following is working:
- mySqlConnection
- mySqlCommand (data is returned when one clicks on Execute )
But the DataAdapter Fill and Preview fails (although I can bind the specific table to the data grid view in the designer, but no data is being displayed when I run the application):
- Fill -> SelectCommand property not initialized before calling Fill
- Preview -> Unable to cast COMObject of type System.__ComObject ... No such Interface supported ...
Is there any order in which the Core Lab objects should be loaded?
The following has been added:
- MySQLConnector
- MySQLDataAdapter
- MySQLDataSet
- GridView with Binding Source
Any help or pointers will be appreciated (I also need to bind data to a form with text fields, but that's another story) ...
Data binding in Visual Studio Express
Let me rephrase the question somewhat ...
When trying to bind a DataAdapter to a gridView, should one add any additional code, or will the adding of Core Lab objects handle that automatically?
And how would one bind data to a form with text fields (I'm specifically referring to C# with the Core Lab MyDirect product)?
thanks!
When trying to bind a DataAdapter to a gridView, should one add any additional code, or will the adding of Core Lab objects handle that automatically?
And how would one bind data to a form with text fields (I'm specifically referring to C# with the Core Lab MyDirect product)?
thanks!
Use the following code:When trying to bind a DataAdapter to a gridView, should one add any additional code, or will the adding of Core Lab objects handle that automatically?
Code: Select all
mySqlDataAdapter1.Fill(dataSet1);
dataGridView1.DataSource = dataSet1;
dataGridView1.DataMember = "table name>";
For these purposes I suggest you using our MySqlDataTable component.And how would one bind data to a form with text fields (I'm specifically referring to C# with the Core Lab MyDirect product)?
Thanks for the reply, so one should add a little bit of code to make all of this work.
As per my e-mail, could the usage of Connector/NET (from mySQL) be part of the grid view load up (and preview) problem?
I've used that when I started with the project, and it is still connecting to the database upon load up. Would that cause a conflict with myDirect?
As per my e-mail, could the usage of Connector/NET (from mySQL) be part of the grid view load up (and preview) problem?
I've used that when I started with the project, and it is still connecting to the database upon load up. Would that cause a conflict with myDirect?