Exemple #1
0
 public static int maxid(string tablename)
 {
     using (conn con = new conn())
     {
         int i = con.exeiscalar("select max(id) from " + tablename);
         return i;
     }
 }
Exemple #2
0
 public static int getivalue(string tablename, string getziduan, string tiaojian)
 {
     using (conn con = new conn())
     {
         int i = con.exeiscalar("select " + getziduan + " from " + tablename + " where " + tiaojian);
         return i;
     }
 }
Exemple #3
0
 public static int getcount(string tablename)
 {
     using (conn con = new conn())
     {
         int i = con.exeiscalar("select count(classid) from " + tablename);
         return i;
     }
 }
Exemple #4
0
 public static int getcount(string tablename,string colName, string tiaojian)
 {
     using (conn con = new conn())
     {
         int i = con.exeiscalar("select count(" + colName + ") from " + tablename + " where " + tiaojian);
         return i;
     }
 }
Exemple #5
0
 //执行sql语句
 public static int exeisql(string sql)
 {
     int i = 0;
     using (conn con = new conn())
     {
         i = con.exeiscalar(sql);
         return i;
     }
 }