public DataTable ShowData(string s1)
{
OleDbConnection CN = new OleDbConnection();
CN.ConnectionString = "provider = microsoft.Ace.oledb.12.0; Data source = D:\\Database 10.accdb";
CN.Open();
OleDbCommand CMT = new OleDbCommand(s1, CN);
OleDbDataReader da = CMT.ExecuteReader();
DataTable DT = new DataTable();
DT.Load(da);
CN.Close();
return DT;
}
{
OleDbConnection CN = new OleDbConnection();
CN.ConnectionString = "provider = microsoft.Ace.oledb.12.0; Data source = D:\\Database 10.accdb";
CN.Open();
OleDbCommand CMT = new OleDbCommand(s1, CN);
OleDbDataReader da = CMT.ExecuteReader();
DataTable DT = new DataTable();
DT.Load(da);
CN.Close();
return DT;
}

Joe WilsonPosted Jun 23, 2014, 12:51 PM
Sunny ShaikhPosted Jun 17, 2014, 7:38 AM
other wise you insert your "accdb" file in a folder and change your connection string.
D:\New folder\Database10.accdb
Joe WilsonPosted Jun 17, 2014, 3:53 AM
Sagar PardeshiPosted Jun 16, 2014, 11:32 AM
login.aspx
string connStr = ConfigurationManager.ConnectionStrings["xyz"].ToString();
OleDbConnection conn = new OleDbConnection(connStr);
conn.Open();
Joe WilsonPosted Jun 16, 2014, 10:39 AM
Does it any problem in my connection string.
Joe WilsonPosted Jun 16, 2014, 10:37 AM
private void Acceptbtn_Click(object sender, EventArgs e)
{
Connection.connectionString = @"provider = microsoft.Ace.oledb.12.0; Data source = D:\\Database 10.accdb";
Connection d1 = new Connection();
bool b = d1.IsExist("select * from Administration where Student_Number = '" + textBox3.Text + "' and Student_ID = '" + textBox2.Text + "'");
if (b)
{
this.Hide();
Form1 m1 = new Form1();
m1.ShowDialog();
}
else
lblInfo.Text = "Not Exist !";
}
Akhil MittalPosted Jun 16, 2014, 8:16 AM
Shweta LodhaPosted Jun 16, 2014, 8:02 AM