public static bool AddNewUser(string userID, string sql) { string queryUserSQL = "SELECT * FROM TabTeachers WHERE User_ID = '" + userID + "'"; DataSet ds = ConnHelper.GetDataSet(queryUserSQL); DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0) { return(false); } else if (dt.Rows.Count == 0) { if (ConnHelper.ExecSQL(sql)) { return(true); } return(false); } else { return(false); } }
/// <summary> /// 执行DAL层查询语句,返回DataSet /// </summary> /// <param name="strSql">sql语句</param> /// <returns></returns> public static DataSet GetDsBySql(string strSql) { return(ConnHelper.GetDataSet(strSql)); }