views:

64

answers:

1

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
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
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
yes dude u r rite. thanx srini.
srinivas