i need to know how to dynamically sort the column's data.i just placed a radgrid and dynamically binded through the following...
con = new SqlConnection("Data Source=ServerName;Initial Catalog=Databasename;User ID=sa;Password=*******");
con.Open();
cmd = new SqlCommand("select * from TableName where Department ='FieldName'", con);
reader = cmd.ExecuteReader();
RadGrid1.DataSource = reader;
RadGrid1.DataBind();
con.Close();
and i aslo enable the radgrid properties such as sorting , paging, auto generate columns, at the design time itself ...when i click on the column header at runtime .. it shows error like below..
Server Error in '/' Application.
Exception Details: System.InvalidOperationException: Invalid attempt to call FieldCount when reader is closed.
Source Error:
Stack Trace:
pls reply me quick...i i'm in urgent
con = new SqlConnection("Data Source=ServerName;Initial Catalog=Databasename;User ID=sa;Password=*******");
con.Open();
cmd = new SqlCommand("select * from TableName where Department ='FieldName'", con);
reader = cmd.ExecuteReader();
RadGrid1.DataSource = reader;
RadGrid1.DataBind();
con.Close();
and i aslo enable the radgrid properties such as sorting , paging, auto generate columns, at the design time itself ...when i click on the column header at runtime .. it shows error like below..
Server Error in '/' Application.
Invalid attempt to call FieldCount when reader is closed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidOperationException: Invalid attempt to call FieldCount when reader is closed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
pls reply me quick...i i'm in urgent