You can merge two data tables if you want.
A new data column will be added to the original data table, provided the primary keys are the same.
Declare a
DataTable
as a member variable in your class
private DataTable dt1;
In this case I didn't have a database so I initialized the data table myself.
public Form1()
{
InitializeComponent();
dt1 = new DataTable();
DataColumn dcPrimary = dt1.Columns.Add("ID", typeof(int));
dt1.Columns.Add("OriginalText", typeof(string));
dt1.PrimaryKey = new DataColumn[] { dcPrimary };
dt1.Rows.Add(1, "Hello world.");
dt1.Rows.Add(2, "Goodbye cruel world.");
dataGridView1.DataSource = dt1.DefaultView;
}
Then in an update method you do like this
private void AddLanguage(object sender, EventArgs e)
{
DataTable dt2 = new DataTable();
DataColumn dcPrimary = dt2.Columns.Add("ID", typeof(int));
dt2.Columns.Add("AlternativeText", typeof(string));
dt2.PrimaryKey = new DataColumn[] { dcPrimary };
dt2.Rows.Add(1, "Hejsan världen.");
dt2.Rows.Add(2, "Hejdå grymma värld.");
dt1.Merge(dt2);
}
(I don't speak Japanese, so I used Swedish instead)
Of course this solution doesn't match your question completely, but I think you can modify the code and make it work.