Working C # code for MySql5.5 Stored Procedures IN parameters,

Source: Internet
Author: User

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;

  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.