mimic SQL Server SelectCommand.Parameters

mimic SQL Server SelectCommand.Parameters

Postby 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???

Postby 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.

Return to dotConnect for MySQL