110,538
社区成员
发帖
与我相关
我的任务
分享
public static int ChiDao(string name, DateTime mintime,DateTime maxtime)
{
try
{
SqlParameter[] par = new SqlParameter[]
{
new SqlParameter("@name",SqlDbType.VarChar).Value=name,
new SqlParameter("@datemin",SqlDbType.DateTime).Value=mintime,
new SqlParameter("@datemax",SqlDbType.DateTime).Value=maxtime,
new SqlParameter("@shuchu",SqlDbType.Int).Direction=ParameterDirection.Output
};
DBHelper.ExecuteCommand("chaxunchidao",par);
}
catch (Exception)
{
throw;
}
public static void ExecuteCommand(string name, SqlParameter[] paramArray)
{
using (conn = new SqlConnection(SqlConn))
{
try
{
command = new SqlCommand();
command.CommandText = name;
command.Connection = conn;
command.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paramArray.Length; i++)
{
command.Parameters.Add(paramArray[i]);
}
conn.Open();
command.ExecuteNonQuery();
}
catch (Exception e)
{
throw e;
}
}
}
return (int)par[3].Value;