Working C # code for MySql5.5 Stored Procedures IN parameters,
MySQL5.5 stored procedure:
# Insert a 文deldelimiter $ drop procedure if exists 'geovindu '. 'proc _ Insert_BookKindList '$ create procedure 'geovindu '. 'proc _ upload' (IN param1Name NVarChar (1000), IN param1Parent Int) BEGIN insert into BookKindList (BookKindName, BookKindParent) values (param1Name, param1Parent); END $ DELIMITER;
/// <Summary> /// append record /// </summary> /// <param name = "BookKindListInfo"> </param> /// <returns> </returns> public int InsertBookKindList (BookKindListInfo bookKindList) {int ret = 0; try {MySqlParameter [] par = new MySqlParameter [] {new MySqlParameter ("? Param1Name ", MySqlDbType. VarChar, 1000), new MySqlParameter ("? Param1Parent ", MySqlDbType. int32, 4),}; par [0]. value = bookKindList. bookKindName; par [1]. value = bookKindList. bookKindParent; ret = MySqlHelpDu. executeSql ("proc_Insert_BookKindList", CommandType. storedProcedure, par);} catch (MySqlException ex) {throw ex;} return ret ;}
Using MySql. Data; // 6.9.5.0 tu juwen annotation, install MYSQL 5.5, and call later Connector/Net
using MySql.Data.MySqlClient;