public BasePage() { dc = new SalesContextDataContext(ConfigurationManager.ConnectionStrings["SalesConnectionString"].ConnectionString); HttpContext.Current.Response.AddHeader("Cache-Control", "no-cache, no-store, must-revalidate"); HttpContext.Current.Response.AddHeader("Pragma", "no-cache"); HttpContext.Current.Response.AddHeader("Expires", "0"); }
public static List <Product> GetProuctName(string pre) { List <Product> possibleProduct = new List <Product>(); using (SalesContextDataContext dc = new SalesContextDataContext(ConfigurationManager.ConnectionStrings["SalesConnectionString"].ConnectionString)) { possibleProduct = (from a in dc.Products where a.ProductName.StartsWith(pre) select a).ToList(); } return(possibleProduct); }
protected void Page_Load(object sender, EventArgs e) { dc = new SalesContextDataContext(ConfigurationManager.ConnectionStrings["SalesConnectionString"].ConnectionString); }