usingSystem.Data;usingSystem.Data.SqlClient SqlConnection Conn=NewSqlConnection (System.configuration.configurationmanager.connectionstrings[siteclass.dbname]. ToString ()); SqlCommand cmd=NewSqlCommand ("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, -); Cmd. Parameters.Add ("@success", Sqldbtype.bit); Cmd. Parameters.Add ("@eval", SqlDbType.NVarChar, -); 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 (); stringalert = cmd. parameters["@alert"]. Value.tostring (); BOOLSuccess = cmd. parameters["@success"]. Value.tostring (). Asbool (); stringeval = cmd. parameters["@eval"]. Value.tostring (); Search Response.Write (Siteclass.writejson (true,true, Alert,"", eval)); Response.End ();
[C # for SQL Operations] C # for SQL Server 2008 database operations