Dear,
I did like this
For Table (X)
string Coonstring = "datasource=localhost;port=3306;username=root;password=;
string cmd = "Insert into X ( material_Name , Material_number )values( '" + this.comboBox1.Text + "','" + this.txt_out1.Text + "');";
MySqlConnection connectionDatabase = new MySqlConnection(Coonstring);
MySqlCommand cmddata = new MySqlCommand(cmd, connectionDatabase);
MySqlDataReader myreader;
try
{
connectionDatabase.Open();
myreader = cmddata.ExecuteReader();
MessageBox.Show("Done");
while (myreader.Read())
{
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Then i loaded this table to data gridview.
FOR Table (Y)
string Coonstring = "datasource=localhost;port=3306;username=root;password=;
string cmd = "Insert into Y ( material_Name )values('" + this.txt_out1.Text + "');";
MySqlConnection connectionDatabase = new MySqlConnection(Coonstring);
MySqlCommand cmddata = new MySqlCommand(cmd, connectionDatabase);
MySqlDataReader myreader;
try
{
connectionDatabase.Open();
myreader = cmddata.ExecuteReader();
MessageBox.Show("Done");
while (myreader.Read())
{
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Then i loaded it too to data grideview.
So now I have two tables loaded on data gridview
(X) That contain ( material_Name , Material_number) and shown in data gridview .
(Y) that contain (Material_Name , Total ) shown in data girdview. but her i just insert the Material_name and the (Total) appear (0) as initial. This column should be fill by itself when i insert the Material_number in table (X).
So Please, After this what i should do? what you mean by DAL. And how i can make calculation using it and insert the result in the column (Total) in table Y ?
Many thanks.