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;
}


Shweta LodhaRank #31 · 39.8K reputationPosted Jun 16, 2014, 4:02 AM EDT
Akhil MittalRank #133 · 16.9K reputationPosted Jun 16, 2014, 4:16 AM EDT
Sunny Shaikh50 reputationPosted Jun 17, 2014, 3:38 AM EDT
other wise you insert your "accdb" file in a folder and change your connection string.
D:\New folder\Database10.accdb
Joe WilsonRank #631 · 3.8K reputationPosted Jun 16, 2014, 6:37 AM EDT
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 !";
}
Joe WilsonRank #631 · 3.8K reputationPosted Jun 16, 2014, 6:39 AM EDT
Does it any problem in my connection string.
Sagar PardeshiRank #103 · 20.8K reputationPosted Jun 16, 2014, 7:32 AM EDT
login.aspx
string connStr = ConfigurationManager.ConnectionStrings["xyz"].ToString();
OleDbConnection conn = new OleDbConnection(connStr);
conn.Open();
Joe WilsonRank #631 · 3.8K reputationPosted Jun 16, 2014, 11:53 PM EDT
Joe WilsonRank #631 · 3.8K reputationPosted Jun 23, 2014, 8:51 AM EDT