mimic SQL Server SelectCommand.Parameters

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply

mimic SQL Server SelectCommand.Parameters

Post by darling1906 » Tue 10 May 2005 19:22

I am new to using your product so I have a question..

I have a app built in asp.net and SQL server that I am trying to move over to mysql. I have your professional 2.8 installed and write in C#

Now.. my question is in my select query I am saying:

Select * from table where (field = :field);

I am passing variables from page to page

I want my query to run based on the value passed.

In SQL sever its simply

SqlDataAdapter1.SelectCommand.Parameters["@field"].Value = variable;

I tried doing the same suing your product and I get errors..

i am replacing ["@field"] with [":field"] and saying
mySqlDataAdapter1.SelectCommand.Parameters[":field"].Value = variable;

can anyone help???


Post by Serious » Wed 11 May 2005 06:34


Code: Select all

mySqlDataAdapter1.SelectCommand.Parameters["field"].Value = variable; 
Please see "Using parameters" article in MySQLDirect .NET help.

Post Reply