kisslogicgoodbye
Programmer
I have a parent form with a combo box with Company Name and ID. When a button is clicked, I want a child form to open that contains a datagrid populated from SQL2000. I want to pull only those records for the company that is choesen in the parent combobox. I'm missing some fundamental concept to get this working.
Heres code from the parent creating the child
private void openChecks(Object sender, EventArgs e){
// make the Checks panel the active panel
ChecksList newChecksList = new ChecksList();
newChecksList.MdiParent = this;
newChecksList.Show();
}
And here is code for the SELECT for the child:
this.sqlSelectCommand1.CommandText = "SELECT Checks_ID, PaidBy_ID, EnterBy, EnterDate, ChangeDate, ChangeBy, CheckNumber, CheckDate, DepositDate, Amount, Notes FROM tblChecks WHERE PaidBy_ID=@ParameterCompany";
this.sqlSelectCommand1.Connection = this.sqlConnection2;
this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("ParameterCompany", System.Data.SqlDbType.NVarChar));
Heres code from the parent creating the child
private void openChecks(Object sender, EventArgs e){
// make the Checks panel the active panel
ChecksList newChecksList = new ChecksList();
newChecksList.MdiParent = this;
newChecksList.Show();
}
And here is code for the SELECT for the child:
this.sqlSelectCommand1.CommandText = "SELECT Checks_ID, PaidBy_ID, EnterBy, EnterDate, ChangeDate, ChangeBy, CheckNumber, CheckDate, DepositDate, Amount, Notes FROM tblChecks WHERE PaidBy_ID=@ParameterCompany";
this.sqlSelectCommand1.Connection = this.sqlConnection2;
this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("ParameterCompany", System.Data.SqlDbType.NVarChar));