I am new to MySqlDirect am trying create a simple master detail in a Visual Studio 2003 Web application.
I've used the code numerous times connecting to a MSDE database, but I'm strugling using MySQL and MySQLDirect.
I want populate a datalist on one page, then carry a value (selected choice) through the URL to another page and populate a datagrid based on the value passed over.
When debugging, the querystring value is passed over, but I get an error saying "Invalid index -1 for this Parameters"
Does a MySqlDataAdapter work in exactly the same way as an SqlDataAdapter?
Has anybody got any code samples?
I also wanted to populate a label with teh selected choice.
Part of the code was
"dtrMenu = MySqlCommand1.ExecuteReader"
But this gives an error saying,
"Value of type 'CoreLab.MySql.MySqlDataReader' cannot be converted to 'System.Data.SqlClient.SqlDataReader'."
Thanks
Master/Detail help
You use parameters in incorrect way.When debugging, the querystring value is passed over, but I get an error saying "Invalid index -1 for this Parameters"
To learn how to use them see 'Using Parameters' article.
Probably the type of dtrMenu is System.Data.SqlClient.SqlDataReader, this is not correct: use IDataReader or MySqlDataReader instead (see MySqlDataReader inheritance hierarchy)."Value of type 'CoreLab.MySql.MySqlDataReader' cannot be converted to 'System.Data.SqlClient.SqlDataReader'."
You can find demo projects in the %ProgramFiles%\CoreLab\MySQLDirect.NET\Samples folder.Has anybody got any code samples?
One more remark: converting projects that use SQL Server to projects that use MySQL (and MySQLDirect .NET) is not a good practice. Create a new project and use MySQLDirect .NET designers to avoid common errors.