Tuesday, 4 November 2014

winform login check from access database

string strcnn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb";
OleDbConnection cnn = new OleDbConnection(strcnn);
cnn
.Open();
string reqet = "SELECT count(*) FROM login";
OleDbCommand cmd = new OleDbCommand(reqet, cnn);
int x = (int)cmd.ExecuteScalar();

if (x>0)
MessageBox.Show("login successfully");
else
MessageBox.Show("invalid username or pwd !");

cnn
.Close();

No comments:

Post a Comment

Working with 3- Tier Architecture in C#

  Introduction In this article we will learn Use to 3- Tier architecture in C#.NET application. 3-Tier architecture is very famous and ...