Hi ive created this code for search and when i debug the applicaion it gives me an error with Variables, I dont understand a thing about variables, ive searched for a chapter on variables but i cant seem to find it on line, if any1 knows wer i can find any good C# books online for free please help me with the link.
Error 1 An object reference is required for the nonstatic field, method, or property 'Variables.client_ID'
Error 2 Operator '==' cannot be applied to operands of type 'string' and 'int'.
Error 3 An object reference is required for the nonstatic field, method, or property 'Variables.client_ID'
Error 4 An object reference is required for the nonstatic field, method, or property 'Variables.client_ID'
Error 5 'Call_login.Client' does not contain a definition for 'client_IDLabel_Click'
private void searchBtn_Click(object sender, EventArgs e)
{
string client_ID = "";
string tittle = "";
string client_f_name = "";
string client_l_name = "";
string technician_ID = "";
string item_name = "";
string status = "";
string email = "";
string tel_no = "";
string extension_no = "";
string serial_no = "";
string call_no = "";
string address = "";
string date_assigned = "";
string office_no = "";
Client pp = new Client();
pp.ShowDialog();
//int client_ID = Variables.client_ID;
[U]if (Variables.client_ID == 0)[/U]
{
client_IDTextBox.Text = "" + client_ID;
}
else
{
try
{
OleDbConnection conn = new OleDbConnection(@"provider = Microsoft.Jet.OLEDB.4.0;Data Source= C:\Documents and Settings\Developers ITD\My Documents\Visual Studio 2005\Projects\Call_login\Call_login\call login.mdb");
conn.Open();
OleDbCommand commander = new OleDbCommand(
"SELECT CLIENT_ID, tittle, client_f_name, client_l_name, technician_ID, ITEM_NAME, STATUS, EMAIL, TEL_NO, EXTENSION_NO, SERIAL_NO, CALL_NO, ADDRESS, date_Assigned, OFFICE_NO = '" + Variables.client_ID + "'", conn);
commander.CommandType = CommandType.Text;
OleDbDataReader reader = commander.ExecuteReader();
if (reader.Read())
{
client_ID = (reader.GetString(0));
tittle = (reader.GetString(1));
client_f_name = (reader.GetString(2));
client_l_name = (reader.GetString(3));
technician_ID = (reader.GetString(4));
item_name = (reader.GetString(5));
status = (reader.GetString(6));
email = (reader.GetString(7));
tel_no = (reader.GetString(8));
extension_no = (reader.GetString(9));
serial_no = (reader.GetString(10));
call_no = (reader.GetString(11));
address = (reader.GetString(12));
date_assigned = (reader.GetString(13));
office_no = (reader.GetString(14));
}
reader.Close();
conn.Close();
client_IDTextBox.Text = client_ID;
tittleTextBox.Text = tittle;
client_f_NameTextBox.Text = client_f_name;
client_l_NameTextBox.Text = client_l_name;
technician_IDTextBox.Text = technician_ID;
item_NameTextBox.Text = item_name;
statusTextBox.Text = status;
emailTextBox.Text = email;
tel_NoTextBox.Text = tel_no;
extension_NoTextBox.Text = extension_no;
serial_NoTextBox.Text = serial_no;
call_NoTextBox.Text = call_no;
addressTextBox.Text = address;
date_AssignedDateTimePicker.Text = date_assigned;
client_IDTextBox.Text = "" +[U] Variables.client_ID[/U];
}
catch
{
}
}
}
}
}