R – How to use both DataSource and DataSourceID in gridview

asp.netgridviewobjectdatasource

work on C# asp.net vs05.i need to save some value and show them on the gridview.So under the button event i write a code that save value ,and show on gridview.I can save value but problem occur when show on gridview.So i use the DataSource .I also set the GridviewTask-->Choose Data Source--> DataSourceID ,because user need to edit information set on the page. after use the DataSourceID show this error message :
Both DataSource and DataSourceID are defined on 'GridView2'. Remove one definition.

How can i use the both in one grid view?if i can not? then how to give user this facility that they can edit information set on the grid with out use any other contorl.

Best Answer

You cannot - either use DataSource or DataSourceID - but you can't use both at the same time.

From your question, it's not quite clear why you'd want to use both at the same time. What is it exactly that you're trying to accomplish?? Please clarify.

Marc