mysql存储过程:mysql存储过程及c#调用标准版来源: 发布时间:星期二, 2009年1月6日 浏览:181次 评论:0
="t18">private
![]() ![]() ![]() ![]() { ////////////////////////////////////////////////////////////////////////////// ///获取用户名、邮件及设定密码 ![]() ![]() ![]() ![]() ![]() ///存储过程为: ///CREATE PROCEDURE `yuan_user_cc`(in xname varchar(100),in xemail varchar(100),in xpassword varchar(100),out xid ![]() ///begin ///insert ![]() ///select id ![]() ///end ////////////////////////////////////////////////////////////////////////////// Int16 id;//返回 ![]() MySqlConnection mysqlcon; MySqlDataAdapter mysqldata = ![]() ![]() DataSet data ![]() ![]() ![]() mysqlcon = ![]() ![]() mysqldata.SelectCommand = ![]() ![]() mysqldata.SelectCommand.Connection = mysqlcon; mysqldata.SelectCommand.CommandText = "yuan_user_cc"; mysqldata.SelectCommand.CommandType = CommandType.StoredProcedure; //设置参数 ![]() MySqlParameter name_parameter = ![]() ![]() ![]() name_parameter.Value = name; mysqldata.SelectCommand.Parameters.Add(name_parameter); // ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() MySqlParameter email_parameter = ![]() ![]() ![]() email_parameter.Value = email; mysqldata.SelectCommand.Parameters.Add(email_parameter); // ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() MySqlParameter password_parameter = ![]() ![]() ![]() password_parameter.Value = password; mysqldata.SelectCommand.Parameters.Add(password_parameter); // ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() MySqlParameter id_parameter = ![]() ![]() ![]() id_parameter.Direction=ParameterDirection.Output; mysqldata.SelectCommand.Parameters.Add(id_parameter); // ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() try { mysqldata.Fill(data ![]() id = (Int16)id_parameter.Value; ![]() ![]() ![]() } catch (MySqlException ex) { MessageBox.Show(ex.Message); ![]() } } 0
相关文章
读者评论发表评论 |