如实例
public bool add(M.DisciplineContructGradeInfo mod)
{
SqlParameter[] para ={
new SqlParameter("@zx","insert"),
new SqlParameter("@id",mod.Id),
new SqlParameter("@ContructGrade",mod.ContructGrade),
};
int i = Convert.ToInt32(SqlHelper.ExecuteNonQuery("storedProcName", para));
if (i > 0)
return true;
else
return false;
}
sqlheaper类代码 storedProcName存储过程名
依次调用
public static int ExecuteNonQuery(string storedProcName, IDataParameter[] para)
{
SqlCommand cmd = BuildCommand(storedProcName, para);
int i = cmd.ExecuteNonQuery();
return i;
}
public bool add(M.DisciplineContructGradeInfo mod)
{
SqlParameter[] para ={
new SqlParameter("@zx","insert"),
new SqlParameter("@id",mod.Id),
new SqlParameter("@ContructGrade",mod.ContructGrade),
};
int i = Convert.ToInt32(SqlHelper.ExecuteNonQuery("storedProcName", para));
if (i > 0)
return true;
else
return false;
}
sqlheaper类代码 storedProcName存储过程名
依次调用
public static int ExecuteNonQuery(string storedProcName, IDataParameter[] para)
{
SqlCommand cmd = BuildCommand(storedProcName, para);
int i = cmd.ExecuteNonQuery();
return i;
}