Hmm yeah never mind about the constructor. Here the question I have currently I am making a login access form and the code I have his has follow:
Code:
// Creates a new instance of a person
person Person;
Person = new person(txtUser.Text,txtPass.Text,"",1);
OleDbConnection connect = new OleDbConnection();
connect.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Jean\Desktop\Jessenger.accdb;User Id=admin;Password=;";
connect.Open();
string query = "SELECT * FROM Member WHERE userID = " + person.Username + " AND userPassword = " + person.Password;
OleDbDataAdapter adapt = new OleDbDataAdapter(query, connect);
OleDbCommandBuilder commandbuilder = new OleDbCommandBuilder(adapt);
DataTable dtTable = new DataTable();
adapt.Fill(dtTable);
/*
if ()
{
JessengerList ChatList = new JessengerList();
ChatList.Show();
this.Visible = false;
ChatList.Show();
}
*/
connect.Close();
The only questions I really have is if its empty because user mistake or something, I am not familiar with Datable, but if its empty, I have an issues stating its empty(obviously), but why would it give me a warning. Should I try to catch an exception or something in this matter? Also i am wondering if on every form i am opening, should i open a new connection all the time ( cause they are required) or should i somehow determine globably ( i am thinking somekind of class) and wait until user ends the session??