Okay...Ive modified my original code so that I now have two datagrids. One is for the information that I am pulling from the database that is constant for every instance of information. The other is for information that varies from instance to instance. Ive gotten the first database to where it is pulling the correct information and I wrote the code so that it filters the info for the second datagrid by using the "PruID" pulled into the first datagrid. However, when I run the code, I get a blank datagrid for the second one. Here is the code for the click event:
Try
Me.SqlSelectCommand1.Parameters.Add("@PermitNum", SqlDbType.VarChar)
Me.SqlSelectCommand1.Parameters("@PermitNum").Value = TextBox1.Text
Me.LoadDataSet31()
Me.DataGrid1.SelectedIndex = -1
Me.DataGrid1.DataBind()
Me.SqlSelectCommand2.Parameters.Add("@PruID", SqlDbType.Variant)
Me.SqlSelectCommand2.Parameters("@PruID").Value = Me.DataGrid1.DataKeyField
Me.LoadDataSet51()
Me.DataGrid2.SelectedIndex = -1
Me.DataGrid2.DataBind()
Catch eLoad As System.Exception
Me.Response.Write(eLoad.Message)
End Try
Any ideas as to why this is happening?
Try
Me.SqlSelectCommand1.Parameters.Add("@PermitNum", SqlDbType.VarChar)
Me.SqlSelectCommand1.Parameters("@PermitNum").Value = TextBox1.Text
Me.LoadDataSet31()
Me.DataGrid1.SelectedIndex = -1
Me.DataGrid1.DataBind()
Me.SqlSelectCommand2.Parameters.Add("@PruID", SqlDbType.Variant)
Me.SqlSelectCommand2.Parameters("@PruID").Value = Me.DataGrid1.DataKeyField
Me.LoadDataSet51()
Me.DataGrid2.SelectedIndex = -1
Me.DataGrid2.DataBind()
Catch eLoad As System.Exception
Me.Response.Write(eLoad.Message)
End Try
Any ideas as to why this is happening?