Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate DataGrid Dynamically

Status
Not open for further replies.

scabral79

MIS
May 16, 2007
25
US
Hi,

i need to populate a datagrid dynamically based on data from a stored procedure that is stored locally using dataadapter.

the issue i am having is that the stored procedure uses a parameter and based on the parameter a different set of fields is returned.

How do i populate or build the datagrid based on the different fields that are returned? do i need to build multiple datagrids based on the different result sets or is there a way to build it dynamically?

thanks
Scott
 
set the AutoGenerateColumns="true" in the datagrid.
Code:
<asp:DataGrid ID="foo" AutoGenerateColumns="true">
</asp:DataGrid>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top