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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding Untyped Dataset to Datagrid

Status
Not open for further replies.

nstouffer

Programmer
Jan 11, 2002
52
US
I have a stored procedure i want to use, but the dataadapter won't generate a dataset, because it doesn't recognize the #tmp tables the sp is using. How can i use an untyped dataset to accomplish this.

Normal SQL:
SqlDataAdapter2.fill(Dataset21)
Datagrid1.Databind()

'''where the Datagrid's properties are already set to dataset, table, and keymember.

#tmp Stored Procedure:
Would I do something like this?

SqlDataAdapter3.fill(Dataset31)
DataGrid2.DataSource = "Dataset31"
DataGrid2.DataMember = "Table"
DataGrid2.DataKeyField = "Center"
DataGrid2.DataBind()

It doesn't seem to show up...any suggestions? thanks!
 
oh, nevermind...it was easier than I thought, thanks for listening though.

In the Untyped Dataset Properties, you need to manually add a table and the appropriate columns. Then the datagrid will be able to "see" the appropriate columns, then you can add those columns to the datagrid properties... And the rest will work like before.

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top