View with Parameters - Generated SELECT statement - Specifice method is not supported.
View with Parameters - Generated SELECT statement - Specifice method is not supported.
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
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
We don't experience any problems.
Take a look on the code snippet below:
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();
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.
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.
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">
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">