Hi,
I have a stored procedure taking in a datetime parameter as follows:
CREATE DEFINER=`root`@`localhost` PROCEDURE `p5`(inizio DATETIME)
BEGIN
SELECT * FROM allottment WHERE dal > inizio;
END
My C# code is as follows:
MySqlCommand oCmd = new MySqlCommand("p5", sqlConn);
oCmd.Parameters.Add("inizio", MySqlDbType.Datetime).Value = "2007-03-25";// new DateTime(2008, 4, 12, 18, 17, 15); DateTime.Now;
MySqlDataAdapter adapter = new MySqlDataAdapter(oCmd);
adapter.Fill(ds);
But when run the following exception occurs:
#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'p5' at line 1
I have tried the parameter value as a DateTime as well as a string. No luck.
I am using MySQl 5.1 with Workbench 5.2.28CE.
Please help.
I have a stored procedure taking in a datetime parameter as follows:
CREATE DEFINER=`root`@`localhost` PROCEDURE `p5`(inizio DATETIME)
BEGIN
SELECT * FROM allottment WHERE dal > inizio;
END
My C# code is as follows:
MySqlCommand oCmd = new MySqlCommand("p5", sqlConn);
oCmd.Parameters.Add("inizio", MySqlDbType.Datetime).Value = "2007-03-25";// new DateTime(2008, 4, 12, 18, 17, 15); DateTime.Now;
MySqlDataAdapter adapter = new MySqlDataAdapter(oCmd);
adapter.Fill(ds);
But when run the following exception occurs:
#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'p5' at line 1
I have tried the parameter value as a DateTime as well as a string. No luck.
I am using MySQl 5.1 with Workbench 5.2.28CE.
Please help.