{ openConnection(); comm.CommandType = CommandType.Text; comm.CommandText = sqlstr; comm.ExecuteNonQuery(); } catch (Exception e) { throw new Exception(e.Message); } finally { closeConnection(); } }//执行sql语句
public static OleDbDataReader dataReader(string sqlstr) { OleDbDataReader dr = null; try { openConnection(); comm.CommandText = sqlstr; comm.CommandType = CommandType.Text;
dr = comm.ExecuteReader(CommandBehavior.CloseConnection); } catch { try { dr.Close(); closeConnection(); } catch { } } return dr; }//返回指定sql语句的OleDbDataReader对象,使用时请注意关闭这个对象。 public static void dataReader(string sqlstr, ref OleDbDataReader dr)
上一篇:无需Photoshop等软件 上网也能改图片
下一篇:asp.net 生成图片验证码
|