标签:
using System.Data; using System.Data.SqlClient SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings[SiteClass.dbname].ToString()); SqlCommand cmd = new SqlCommand("dbo.Backorder", conn); conn.Open(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@orderid", SqlDbType.BigInt); cmd.Parameters.Add("@userid", SqlDbType.Int); cmd.Parameters.Add("@alert", SqlDbType.NVarChar, 100); cmd.Parameters.Add("@success", SqlDbType.Bit); cmd.Parameters.Add("@eval", SqlDbType.NVarChar, 100); cmd.Parameters[0].Value = orderid; cmd.Parameters[1].Value = SiteClass.CurrentUserId; cmd.Parameters["@alert"].Direction = ParameterDirection.Output; cmd.Parameters["@success"].Direction = ParameterDirection.Output; cmd.Parameters["@eval"].Direction = ParameterDirection.Output; cmd.ExecuteNonQuery(); string alert = cmd.Parameters["@alert"].Value.ToString(); bool success = cmd.Parameters["@success"].Value.ToString().AsBool(); string eval = cmd.Parameters["@eval"].Value.ToString();搜索 Response.Write(SiteClass.writejson(true,true,alert,"",eval)); Response.End();
[C#对sql操作]C#对sql server 2008数据库操作
标签:
原文地址:http://www.cnblogs.com/beeone/p/5221976.html