Hi,
I am totally new to MySql and the .net connector.
I have an MVC3 application using Entity Framework and Code First with Sql Server that I'm trying to migrate to using MySql. However, I seem to have hit a problem at the very first try.
I have the following procedure created in MySql to return a count.
CREATE PROCEDURE GetCount()
BEGIN
SELECT count(*)
FROM mytable;
END$$
I am trying to call this procedure in my app as
int count = myContext.Database.SqlQuery<int>("GetCount").First();
And it falls over with the error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GetCount' at line 1
Why is this falling over? I can get the same syntax to work fine with Sql Server so I think it may be something with the .net connector. I can also execute the SP itself in MySql BTW. any help appreciated.
Thanks,
I am totally new to MySql and the .net connector.
I have an MVC3 application using Entity Framework and Code First with Sql Server that I'm trying to migrate to using MySql. However, I seem to have hit a problem at the very first try.
I have the following procedure created in MySql to return a count.
CREATE PROCEDURE GetCount()
BEGIN
SELECT count(*)
FROM mytable;
END$$
I am trying to call this procedure in my app as
int count = myContext.Database.SqlQuery<int>("GetCount").First();
And it falls over with the error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GetCount' at line 1
Why is this falling over? I can get the same syntax to work fine with Sql Server so I think it may be something with the .net connector. I can also execute the SP itself in MySql BTW. any help appreciated.
Thanks,