hi all how can i execute a stored proc in mysql db? i have to pass parameters and to catch the result out off stored proc.
+2
A:
Check the articles at http://dev.mysql.com/usingmysql/dotnet/.
Mladen Mihajlovic
2009-07-09 07:51:42
SqlConnection conn = new SqlConnection("Data Source=GANGA;InitialCatalog=eMpratik;Integrated Security=True");SqlCommand command = new SqlCommand("Primarykey", conn);command.CommandType = CommandType.StoredProcedure;command.Parameters.Add("@village", SqlDbType.VarChar);command.Parameters["@village"].Value = village;conn.Open();SqlDataReader reader = command.ExecuteReader();this was the code i wrote for sqlserver.now i want to write the same for my sqlhelpme!
srinivas
2009-07-09 07:58:38
Well, you would need to change SqlConnection to MySqlConnection, SqlCommand to MySqlCommand, etc...You also need to make sure that you've referenced the MySql .NET Connector assembly in your project.The parameters use ? instead of @I think that should be it...
Mladen Mihajlovic
2009-07-09 08:03:32
yes dude u r rite. thanx srini.
srinivas
2009-07-09 12:00:13