日期:2014-05-17 浏览次数:20875 次
public DataTable CheckSMRepeat(string strSM)
{
string sql = "SELECT * from TableA where SM='"+strSM+"'";
DataTable dt = SqlHelperService.ExecuteQuery(sql);
return dt;
}
public static DataTable ExecuteQuery(string sql)
{
GetConn();
SqlDataAdapter sda = new SqlDataAdapter(sql, _Conn);//数据库适配器
DataSet ds = new DataSet();//内存数据库
sda.Fill(ds);//将查询结果填充到内存数据库
return ds.Tables[0];
}
/// <summary>
/// 是否存在该记录
/// </summary>
public bool Exists(string USERGROUPCODE, string USERGROUPNAME, string GROUPCOMMENT, string USERGROUPPARENT)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select count(1) from T_SYSGROUP");
strSql.Append(" where USERGROUPCODE=:USERGROUPCODE and USERGROUPNAME=:USERGROUPNAME and GROUPCOMMENT=:GROUPCOMMENT and USERGROUPPARENT=:USERGROUPPARENT ");
OracleParameter[] parameters = {
new OracleParameter(":USERGROUPCODE", OracleType.VarChar,20),
new OracleParameter(":USERGROUPNAME", OracleType.VarChar,50),
new OracleParameter(":GROUPCOMMENT", OracleType.VarChar,500),
new OracleParameter(":USERGROUPPARENT", OracleType.VarChar,20) };
parameters[0].Value = USERGROUPCODE;
parameters[1].Value =&