M
Mike P
I am binding data to a datagrid, but there is 1 field that I need to use
a separate query to populate.
This is the field :
<asp:TemplateColumn HeaderText="SIP Account/s" ItemStyle-Width="75px"
HeaderStyle-HorizontalAlign=Center ItemStyle-HorizontalAlign=Center>
<ItemTemplate>
<aspropDownList id="ddlSIPAccounts" runat="server"
DataValueField="SIP Account" Font-Name="arial" Font-Size="8pt"
DataTextField="SIP Account"
DataSource='<%# GetSIPAccounts() %>' />
</ItemTemplate>
</asp:TemplateColumn>
But using GetSIPAccounts, I somehow need to only populate each row with
the relevant SIP Accounts for that row - the row identifier is the
Product ID and I need to only show the SIP Accounts for that Product ID
for each row.
This is my GetSIPAccounts procedure :
public DataSet GetSIPAccounts()
{
shopping_cartDB scCart = new shopping_cartDB();
string strCartID = scCart.GetShoppingCartId();
SqlConnection objConnection = new
SqlConnection(ConfigurationSettings.AppSettings["strConnectTest"]);
string strSIPAccounts = "SELECT SIPACCOUNT AS 'SIP Account' FROM
SHOPPING_CART_SIP WHERE CARTID = '" + strCartID + "' AND PRODUCTID = " +
Convert.ToInt32(dgShoppingCart.Items[correct item here].Cells[0].Text);
SqlDataAdapter objDataAdapter = new SqlDataAdapter(strSIPAccounts,
objConnection);
DataSet ddlDataSet = new DataSet();
objDataAdapter.Fill(ddlDataSet, "SIPAccounts");
return ddlDataSet;
}
Can anybody help me out with this? Any help would be really
appreciated!
Cheers,
Mike
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
a separate query to populate.
This is the field :
<asp:TemplateColumn HeaderText="SIP Account/s" ItemStyle-Width="75px"
HeaderStyle-HorizontalAlign=Center ItemStyle-HorizontalAlign=Center>
<ItemTemplate>
<aspropDownList id="ddlSIPAccounts" runat="server"
DataValueField="SIP Account" Font-Name="arial" Font-Size="8pt"
DataTextField="SIP Account"
DataSource='<%# GetSIPAccounts() %>' />
</ItemTemplate>
</asp:TemplateColumn>
But using GetSIPAccounts, I somehow need to only populate each row with
the relevant SIP Accounts for that row - the row identifier is the
Product ID and I need to only show the SIP Accounts for that Product ID
for each row.
This is my GetSIPAccounts procedure :
public DataSet GetSIPAccounts()
{
shopping_cartDB scCart = new shopping_cartDB();
string strCartID = scCart.GetShoppingCartId();
SqlConnection objConnection = new
SqlConnection(ConfigurationSettings.AppSettings["strConnectTest"]);
string strSIPAccounts = "SELECT SIPACCOUNT AS 'SIP Account' FROM
SHOPPING_CART_SIP WHERE CARTID = '" + strCartID + "' AND PRODUCTID = " +
Convert.ToInt32(dgShoppingCart.Items[correct item here].Cells[0].Text);
SqlDataAdapter objDataAdapter = new SqlDataAdapter(strSIPAccounts,
objConnection);
DataSet ddlDataSet = new DataSet();
objDataAdapter.Fill(ddlDataSet, "SIPAccounts");
return ddlDataSet;
}
Can anybody help me out with this? Any help would be really
appreciated!
Cheers,
Mike
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!