using System;
using System.Data;
using System.Data.OleDb;
using System.Web;
namespace baoge.Admin
{
	/// <summary>
	/// UserRegDb 的摘要说明。
	/// </summary>
	public class UserRegDb
	{
		public UserRegDb()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public int UserRegSelect(string UserRegSqlSelect)
		{
			//取得数据库路径
			string dbPath=System.Configuration.ConfigurationSettings.AppSettings["dbPathReg"];
			//定义连接字符串
			string ACconnStr="Provider=Microsoft.Jet.Oledb.4.0;Data Source="+HttpContext.Current.Server.MapPath(dbPath);
			//实例化连接对像
			OleDbConnection ACconn=new OleDbConnection(ACconnStr);
			//实例化Command对像
			OleDbCommand ACcomm=new OleDbCommand(UserRegSqlSelect,ACconn);
			//打开数据库
			ACconn.Open();
			//执行SQL
			int Ci=Convert.ToInt32(ACcomm.ExecuteScalar().ToString());

			//关闭数据库
			ACconn.Close();

			return Ci;
		}


		public int UserReg(string UserRegSql)
		{
			//取得数据库路径
			string dbPath=System.Configuration.ConfigurationSettings.AppSettings["dbPathReg"];
			//定义连接字符串
			string ACconnStr="Provider=Microsoft.Jet.Oledb.4.0;Data Source="+HttpContext.Current.Server.MapPath(dbPath);
			//实例化连接对像
			OleDbConnection ACconn=new OleDbConnection(ACconnStr);
			//实例化Command对像
			OleDbCommand ACcomm=new OleDbCommand(UserRegSql,ACconn);
			//打开数据库
			ACconn.Open();
			//执行SQL
			int i=ACcomm.ExecuteNonQuery();

			//关闭数据库
			ACconn.Close();

			return i;
		}
	}
}
