View with Parameters - Generated SELECT statement - Specifice method is not supported.

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
evidor
Posts: 3
Joined: Tue 11 Apr 2006 18:18

View with Parameters - Generated SELECT statement - Specifice method is not supported.

Post by evidor » Tue 11 Apr 2006 18:22

I have a view in MySQL and in the generated select statement I add a WHERE with a paramter

col1 - DateTime

SELECT col1, col2 FROM tb1 WHERE col1 > :VALUE

and get the error:

Generated SELECT statement: Specified method is not supported.

It seems to work on a table just not a view. Any suggestions?

Thanks

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 12 Apr 2006 07:09

We don't experience any problems.
Take a look on the code snippet below:

Code: Select all

      mySqlConnection.Open();
      mySqlCommand.CommandText = "SELECT col1, col2 FROM tb1 WHERE col1>:VALUE";
      mySqlCommand.Parameters.Add("VALUE", MySqlType.DateTime);
      mySqlCommand.Parameters["VALUE"].Value = DateTime.Now;
      MySqlDataReader reader = mySqlCommand.ExecuteReader();

evidor
Posts: 3
Joined: Tue 11 Apr 2006 18:18

Post by evidor » Wed 12 Apr 2006 13:53

I'm using VS2005 and using the MySQLDirect .NET Data Provider to create a DataSet. and in it attempt to create a Table Adapter. Once I go to "Enter a SQL Statement" in the wizard and get to the Wizard Results I get the

Generated SELECT statement.
Specified method is not supported.

This only happens when I'm trying to use parameters on a view. Normal tables seem to work without any problem.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 12 Apr 2006 14:25

What version of the MySQLDirect do you use?
Download the latest version from our site and try use it.

evidor
Posts: 3
Joined: Tue 11 Apr 2006 18:18

Post by evidor » Wed 12 Apr 2006 15:30

I'm using the 3.50 beta

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 13 Apr 2006 06:33

Send us small test project if possible to reproduce the problem; it is
desirable to use 'test' schema objects, otherwise include definition of
your own database objects. Do not use third party components.

JStal
Posts: 2
Joined: Thu 13 Apr 2006 14:20

Post by JStal » Sat 15 Apr 2006 15:48

I am having a similar problem using declarative databinding in VWD, but I've traced it to the tags. The moment I introduce an , , etc. I get the "Specified Method Not Supported" error. Even if I don't put a scalar variable into my "SELECT..." command, the simple presence of the (or other type of parameter) declared in the block returns the error. Eliminate the parameter declaration and the error goes away.

As a result, I cannot make use of scalar variables and therefore can't use declarative databinding (the most powerful feature of ASP.NET 2.0 in my opinion). Instead, it seems like this leaves me to write code to do all my select statements just like in .NET 1.1 which re-introduces a lot of headaches writing and maintaining code.

Can you help? Confirm what I'm seeing? I've supplied the html code block for the SqlDataSource that offends. Note that the "Code that works" simple has the parameter declaration commented out. It's that simple.

Thanks!

John


Code that works:
"
SelectCommand="SELECT * FROM agents_Contact WHERE Active='True' ORDER BY Last, First">

--%>



Code that doesn't work:
"
SelectCommand="SELECT * FROM agents_Contact WHERE Active='True' ORDER BY Last, First">




Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 17 Apr 2006 08:06

Which version of MySQLDirect .NET do you use?
There is no native type "boolean" in MySQL. It is a synonym for tinyint1.
And where is parameter in your SelectCommand? Parameter name should be preceded by a colon.

JStal
Posts: 2
Joined: Thu 13 Apr 2006 14:20

Post by JStal » Mon 17 Apr 2006 16:16

Yep, you nailed it. It was the boolean type. I changed types and it is working fine now. Thanks!

- John

Post Reply