using System.Data.OleDb;
string ConnStr ="Provider=Microsoft.ACE.OleDb.12.0;Data source=" +@"D:\web\App_Data\db1.accdb";
OleDbConnection oleConnection = new OleDbConnection(ConnStr);
oleConnection.Open();
OleDbCommand mycommand = new OleDbCommand("select * from tUser where uname='" + UserName.Text+"' and upwd='" + Password.Text + "'", oleConnection);
int count = Convert.ToInt32(mycommand.ExecuteScalar());
if (count > 0)
{
Session["UserLoginID"] = Login1.UserName;
Response.Redirect("Default.aspx");
}
oleConnection.Close();