J
js
I am using executeReader to get a SqlDataReader as in my code below.
The SqlDataReader contains two tables. I am trying to bind each table
to its respective dropdown list control. Thanks.
//************* My code *************
System.Data.SqlClient.SqlDataReader dr = null;
string strSQL =
"SELECT id, iorg_name FROM int_org order by iorg_name;" +
"select id, l_name from loc order by l_name";
oDataBroker.sqlStatement = strSQL;
dr = oDataBroker.getDataFromReader(2);
this.cboOrg.DataSource = dr; //how to specify the first table in the
result?
this.cboOrg.DataTextField = "iorg_name";
this.cboOrg.DataValueField = "id";
this.cboOrg.DataBind();
this.cboOrg.Items.Insert(0,String.Empty);
this.cobLocation.DataSource = dr; //how to specify the second table in
the result?
this.cboLocation.DataTextField = "l_name";
this.cboLocation.DataValueField = "id";
this.cboLocation.DataBind();
this.cboLocation.Items.Insert(0,String.Empty);
The SqlDataReader contains two tables. I am trying to bind each table
to its respective dropdown list control. Thanks.
//************* My code *************
System.Data.SqlClient.SqlDataReader dr = null;
string strSQL =
"SELECT id, iorg_name FROM int_org order by iorg_name;" +
"select id, l_name from loc order by l_name";
oDataBroker.sqlStatement = strSQL;
dr = oDataBroker.getDataFromReader(2);
this.cboOrg.DataSource = dr; //how to specify the first table in the
result?
this.cboOrg.DataTextField = "iorg_name";
this.cboOrg.DataValueField = "id";
this.cboOrg.DataBind();
this.cboOrg.Items.Insert(0,String.Empty);
this.cobLocation.DataSource = dr; //how to specify the second table in
the result?
this.cboLocation.DataTextField = "l_name";
this.cboLocation.DataValueField = "id";
this.cboLocation.DataBind();
this.cboLocation.Items.Insert(0,String.Empty);