Alexei Matiko

I have a stored procedure for Cross-table query (like PIVOT in SQL2005).
Proceure execute sql statement which returnes dataset but in this case quantity of columns is not constant.

Am I right to use the following code for data binding or there are any other methods using wizards

string strSql = "exec sp_CrossTab @table='ViewPrixBySeas',@onrows='EgleS.dbo.GetSeas(data)',@onrowsalias=' ',@oncols='seas',@sumcol='summ'";

Microsoft.Office.Tools.Excel.ListObject myListObject = this.Controls.AddListObject(this.Range["A1", missing], "myListObject");

DataSet dsTable = new DataSet();

dsTrims = SomeThing.ExecuteDataSet(System.Data.CommandType.Text, strWhere); (My DataAccess Layer)

this.bindingdataSource1.DataSource = dsTrims;