create a dynamic table from datatable passed from c#
how can we dynamic create table through datatable which is passed from c# with the values
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ravi KumarPosted May 16, 2014, 8:30 AM
try the fallowing code
DataTable dt=new DataTable();
dt.Columns.Add("BarCode", typeof(string));
dt.Columns.Add("ISBN", typeof(string));
dt.Columns.Add("QTY", typeof(int));
dt.Columns.Add("CP", typeof(double));
dt.Columns.Add("AMOUNT", typeof(double));
dt.Columns.Add("DISC", typeof(double));
dt.Columns.Add("CNAME", typeof(string));
dt.Columns.Add("CVALUE", typeof(double));