OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Peerakit\Desktop\ProjectV2.0\ProjectV2.0\bin\Debug\ManageSystemDB.accdb");
OleDbDataAdapter adap = new OleDbDataAdapter("select Count(*) from pin where pin_id='" + textBox1.Text + "'", con);
DataTable DT = new DataTable();
adap.Fill(DT);
if (DT.Rows[0][0].ToString() == "1")
{
this.Hide();
form2 f2 = new form2();
f2.Show();
}
Tag : .NET, Ms Access, Win (Windows App), C#, Windows
Date :
2016-11-23 06:45:32
By :
snowman0020
View :
743
Reply :
1
No. 1
Guest
form 2
Code (C#)
public string str;
ใช้งาน
Code (C#)
if (DT.Rows[0][0].ToString() == "1")
{
this.Hide();
form2 f2 = new form2();
f2.str = DT.Rows[0][0].ToString() ;
f2.Show();
}