I created sql procedure, which returns table from database, where records are in some, defined order. But, when I execute this procedure and using sqldatasource
and show results in GridView
, rows, aren't in the same order as it should be. I checked in SQL Management Studio, and sql procedure works fine. Here is code, how I execute procedure :
ds.SelectCommand = "EXEC MyProcedure";
TableGridView.DataSource = ds.Select(new DataSourceSelectArguments());
TableGridView.DataBind();
ds is SqlDataSource
created using <asp:SqlDataSource .../>