日期:2014-05-17 浏览次数:20716 次
string DiZhi = System.Environment.CurrentDirectory;
string str_conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DiZhi + "\\system.mdb;Persist Security Info=True;Jet OLEDB:Database Password=111";
public class sqlhelper
{
public sqlhelper()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
public static string connstr = ConfigurationManager.AppSettings["accessConnStr"].ToString() + HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["accessdbPath"].ToString()) + ";";
public static string cupage()
{
string strPath = "http://" + HttpContext.Current.Request.ServerVariables["HTTP_HOST"] + HttpContext.Current.Request.ServerVariables["PATH_INFO"] + "?" + HttpContext.Current.Request.ServerVariables["QUERY_STRING"];
if (strPath.EndsWith("?"))
{
strPath = strPath.Substring(0, strPath.Length - 1);
}
return strPath;
}
public static int ExecuteNonQuery(CommandType cmdType, string cmdText, params OleDbParameter[] commandParameters)
{
OleDbCommand cmd = new OleDbCommand();