protected void basic()
{
bool temp = false;
string connection_string = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\HILProject\project4\App_Data\adminlog.mdb";
using (OleDbConnection cn = new OleDbConnection(connection_string))
{
cn.Open();
String str = "select Nationality, Post from BasicDtl_tbl where UserName='" + usertxt.Text.Trim() + "'";
OleDbCommand cmd = new OleDbCommand(str, cn);
cmd.Connection = cn;
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Nattxt.Text = dr.GetString(0);
apldposttxt.Text = dr.GetString(1);
temp = true;
}
if (temp == false)
StatusLabel.Text = "error occured";
cn.Close();
}
}
[Edited]:Set Language Tag