This may be a long shot, but I'm trying to transfer data from GridView1(product database table) into GridView2(order database table), and I'm lost.
Here's what I'm trying:
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow gr1 = GridView1.SelectedRow;
gr1.Cells[1].Text = SqlDataSource3.InsertParameters["ProdId"].DefaultValue;
TextBox tb1 = gr1.FindControl("TextBox1") as TextBox;
SqlDataSource2.InsertParameters["OrderQty"].DefaultValue = tb1.Text;
}
The 3rd Line GridViewRow gr1..... has a select button.
I created a new column with a textbox box that should transfer the OrderQty.
I have two SqlDataSources, one for Product(SqlDataSource2) and one for Order(SqlDataSource3). I keep getting an error:
System.NullReferenceException: Object reference not set to an instance of an object.
Can anyone see where I'm going wrong here?
Both are? What is first and second?