string conn = " server=127.0.0.1;UID=qgf;PWD=happyness820912;Database=ClientManage " ; // 在此处放置用户代码以初始化页面 System.Data.SqlClient.SqlConnection StrSelect = new System.Data.SqlClient.SqlConnection(conn); // 在此处放置用户代码以初始化页面 System.Data.SqlClient.SqlCommand Qgf_sqlcommand = new System.Data.SqlClient.SqlCommand(); Qgf_sqlcommand.CommandText = " Test " ; Qgf_sqlcommand.CommandType = System.Data.CommandType.StoredProcedure; Qgf_sqlcommand.Connection = StrSelect; Qgf_sqlcommand.Parameters.Add( " @Perid " ,SqlDbType.Int, 4 ); Qgf_sqlcommand.Parameters[ " @Perid " ].Direction = ParameterDirection.Output; Qgf_sqlcommand.Parameters.Add( " @z_dutyname " ,SqlDbType.NVarChar, 50 ); Qgf_sqlcommand.Parameters[ " @z_dutyname " ].Direction = ParameterDirection.Output; Qgf_sqlcommand.Parameters.Add( " @id " ,SqlDbType.Int, 4 ); Qgf_sqlcommand.Parameters[ " @id " ].Value = 1 ; StrSelect.Open(); Qgf_sqlcommand.ExecuteNonQuery(); Response.Write(Qgf_sqlcommand.Parameters[ " @z_dutyname " ].Value); 不用多解释吧...这个冬冬是灵魂..8错8错 转载于:https://www.cnblogs.com/qqggff524/archive/2005/12/30/308578.html