I NEED HELP WITH THIS BUTTON IVE ATTACHED THE FORM AND CODE ERROR.
public partial class Client : Form
{
public Client()
{
InitializeComponent();
}
private void clientsBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.clientsBindingSource.EndEdit();
this.clientsTableAdapter.Update(this.dataSet.clients);
}
private void Client_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dataSet.clients' table. You can move, or remove it, as needed.
this.clientsTableAdapter.Fill(this.dataSet.clients);
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
}
private void closeBtn_Click(object sender, EventArgs e)
{
this.Close();
}
private void clearBtn_Click(object sender, EventArgs e)
{
clientIDTextBox.Text = "";
tittleTextBox.Text = "";
client_F_NameTextBox.Text = "";
client_L_NameTextBox.Text = "";
technicianIDTextBox.Text = "";
item_NameTextBox.Text = "";
statusTextBox.Text = "";
office_NoTextBox.Text = "";
emailTextBox.Text = "";
tel_NoTextBox.Text = "";
extension_NoTextBox.Text = "";
serial_NoTextBox.Text = "";
call_NoTextBox.Text = "";
addressTextBox.Text = "";
}
private void saveBtn_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection(@"provider = Microsoft.Jet.OLEDB.4.0;Data Source= C:\Documents and Settings\Developers ITD\My Documents\Visual Studio 2005\Projects\Jackson\Jackson\call.mdb");
{
string client_ID = clientIDTextBox.Text.ToString();
string title = tittleTextBox.Text.ToString();
string client_f_name = client_F_NameTextBox.Text.ToString();
string client_l_name = client_L_NameTextBox.Text.ToString();
string technician_ID = technicianIDTextBox.Text.ToString();
string item_name = item_NameTextBox.Text.ToString();
string status = statusTextBox.Text.ToString();
string email = emailTextBox.Text.ToString();
string tel_no = tel_NoTextBox.Text.ToString();
string extension_no = extension_NoTextBox.Text.ToString();
string serial_no = serial_NoTextBox.Text.ToString();
string call_no = call_NoTextBox.Text.ToString();
string address = addressTextBox.Text.ToString();
string date_assigned = date_AssignedDateTimePicker.Text.ToString();
string office_no = office_NoTextBox.Text.ToString();
OleDbCommand addpro = new OleDbCommand(
"INSERT INTO Client (" +
"CLIENTID, TITLE, CLIENT_F_NAME, CLIENT_L_NAME, TECHNICIANID, ITEM_NAME, STATUS, EMAIL, TEL_NO, EXTENSION_NO, SERIAL_NO, CALL_NO, ADDRESS, DATE_ASSIGNEDDATETIMEPICKER, OFFICE_NO)" +
"VALUES(@CLIENTID, @TITLE, @CLIENT_F_NAME, @CLIENT_L_NAME, @TECHNICIANID, @ITEM_NAME, @STATUS, @EMAIL, @TEL_NO, @EXTENSION_NO, 2SERIAL_NO, @CALL_NO, @ADDRESS, @DATE_ASSIGNEDDATETIMEPICKER, @OFFICE_NO)", conn);
addpro.Parameters.Add("@CLIENTID", OleDbType.VarChar, 50).Value = client_f_name;
addpro.Parameters.Add("@TITLE", OleDbType.VarChar, 50).Value = title;
addpro.Parameters.Add("@CLIENT_F_NAME", OleDbType.VarChar, 50).Value = client_f_name;
addpro.Parameters.Add("@CLIENT_L_NAME", OleDbType.VarChar, 50).Value = client_l_name;
addpro.Parameters.Add("@TECHNICIANID", OleDbType.VarChar, 50).Value = technician_ID;
addpro.Parameters.Add("@ITEM_NAME", OleDbType.VarChar, 50).Value = item_name;
addpro.Parameters.Add("@STATUS", OleDbType.VarChar, 50).Value = status;
addpro.Parameters.Add("@EMAIL", OleDbType.VarChar, 50).Value = email;
addpro.Parameters.Add("@TEL_NO", OleDbType.VarChar, 50).Value = tel_no;
addpro.Parameters.Add("@EXTENSION_NO", OleDbType.VarChar, 50).Value = extension_no;
addpro.Parameters.Add("@SERIAL_NO", OleDbType.VarChar, 50).Value = serial_no;
addpro.Parameters.Add("@CALL_NO", OleDbType.VarChar, 50).Value = call_no;
addpro.Parameters.Add("@ADDRESS", OleDbType.VarChar, 50).Value = address;
addpro.Parameters.Add("@DATE_ASSIGNEDDATETIMEPICKER", OleDbType.VarChar, 50).Value = date_AssignedDateTimePicker;
addpro.Parameters.Add("@OFFICE_NO", OleDbType.VarChar, 50).Value = office_no;
//open the connection and INSERT the BLOB into the Database
conn.Open();
[U]addpro.ExecuteNonQuery();[/U]
conn.Close();
MessageBox.Show("Save Successfull");
}
}
private void new_employeeBtn_Click(object sender, EventArgs e)
{
New_Employee Main = new New_Employee();
Main.Show();
this.Hide();
}
private void change_passwordBtn_Click(object sender, EventArgs e)
{
change_Password Main = new change_Password();
Main.Show();
this.Hide();
}
}
}