S
Sachin
Hi All,
I am using ASP.NET 2.0 and GridView control.
I have a stored procedure, SP_GetAllRows which takes the table name as
parameter and fires the query "Select * from TableName" dynamically.
My GridView defined like,
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSource"
autogeneratecolumns="true"
emptydatatext="No data available."
allowpaging="true"
runat="server">
In the code behinde file, I set the datasource and call databind.
However, gridview does not display any records even when the stored
procedure returns the rows.
I have verified this through debugger. In fact, when no records are returned
it does display the message, "No data avaialable".
I changed the GridView to DataGrid, but it does not work also.
If I use bound columns and explicitely specify the column name it does work.
However, as store procedure returns the records from different tables at run
time, I am using autogeneratecolumns="true".
What could be wrong?
Why autogeneratecolumns="true" is not working?
Any pointer or help?
TIA
Sachin
I am using ASP.NET 2.0 and GridView control.
I have a stored procedure, SP_GetAllRows which takes the table name as
parameter and fires the query "Select * from TableName" dynamically.
My GridView defined like,
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSource"
autogeneratecolumns="true"
emptydatatext="No data available."
allowpaging="true"
runat="server">
In the code behinde file, I set the datasource and call databind.
However, gridview does not display any records even when the stored
procedure returns the rows.
I have verified this through debugger. In fact, when no records are returned
it does display the message, "No data avaialable".
I changed the GridView to DataGrid, but it does not work also.
If I use bound columns and explicitely specify the column name it does work.
However, as store procedure returns the records from different tables at run
time, I am using autogeneratecolumns="true".
What could be wrong?
Why autogeneratecolumns="true" is not working?
Any pointer or help?
TIA
Sachin