Regarding generation of data tables at run time



Iam trying to generate a data table during runtime by using HTML tags in C# code.Can any one please help me in doing this.





I think you may wait for the 1.7. With that new version, you may create a dataset on the page, and bind the Grid's sheet to that dataset with the new Worksheets designer in the

This new version will be released at earlier next month.


Hi Henry,

Thank you for ur quick reply but the solution for the problem is too urgent.The problem iam facing is if i select some values from three different DDL then the data relating to the above selected value in the tables in the report when we click a button the tables should be displayed with the necessary data.And if we select a dealer all the deleas need not have same number of columns and values.So iam unable to decide what to do.I will be if u help me in this reguard.





I think that you want import database data to the sheet with dynamic sql. You may use the OleDbDataAdapter, OleDbCommand and OldDbConnection to run a sql and create a datatable, then import the datatable to the sheet.

here is some sample code:

if (!IsPostBack)
OleDbCommand cmd = new OleDbCommand("select * from employees", oleDbConnection1);
OleDbDataAdapter adp = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet("MyDataSet1");
adp.Fill(ds, "employees");
GridWeb1.WebWorksheets.ImportDataView(ds.Tables["employees"].DefaultView, null, null, "employees", 0, 0);

for more detail information please see the wiki document:

I wish this information can help you.

Thank you.


Hi Henry,

Thank u for ur reply.I need to generate table using HTML tags with values at runtime and the number of rows and columns need not be constant for all the selected dealers from a dropdownlist.The above process should happen when i click a button after selecting some options from three different DDLS and the data in the table must be related to the above selected options.Kindly waiting for ur reply.





I think that your requirement is :

Creating a dropdownlist in the page; Each option of the dropdownlist is related to a sql statement. When a user select a option and click a button on the page, the grid should connect to database and execute the related sql statement, get data from the filled datatable, and render the content of the datatable.

Does above describe your needs correctly?



Maybe you want to create the dropdownlist and the button in the grid?


And I am not very clear about your "generate table using HTML tags ".


Do u have any idea about an error called ICONVERTABLE



Please tell us the details about this error.