Datatable error in asp.net... help me!
-
when i run the below coding i m getting the error 'System.Data.DataRow.DataRow(System.Data.DataRowBuilder)' is inaccessible due to its protection level help me... the coding is below.. DataTable dttable = new DataTable(); DataRow dtrow; DataColumn dtCol; sqlda = new System.Data.SqlClient.SqlDataAdapter("select col from tbl_test", conn); sqlda.Fill(ds); if (ds.Tables[0].Rows.Count != 0) { for (int i = 0; i<ds.tables[0].rows.count;> { dtrow = new DataRow("" + ds.Tables[0].Rows[i][0].ToString() + ""); dttable.Rows.Add(dtrow); } }
-
when i run the below coding i m getting the error 'System.Data.DataRow.DataRow(System.Data.DataRowBuilder)' is inaccessible due to its protection level help me... the coding is below.. DataTable dttable = new DataTable(); DataRow dtrow; DataColumn dtCol; sqlda = new System.Data.SqlClient.SqlDataAdapter("select col from tbl_test", conn); sqlda.Fill(ds); if (ds.Tables[0].Rows.Count != 0) { for (int i = 0; i<ds.tables[0].rows.count;> { dtrow = new DataRow("" + ds.Tables[0].Rows[i][0].ToString() + ""); dttable.Rows.Add(dtrow); } }
try this code. sqlDataAdapter da = =new sqlDataAdapter("Select col from tbl_test',conn); Dataset ds = new DataSet; da.fill(ds,"tab"); DataTable dt = new DataTable(); dt = ds.table(0); DataRow dr = DataRow(); for each dr in dt.rows Messagebox.show(dr.row[o].ToString()); next
-
try this code. sqlDataAdapter da = =new sqlDataAdapter("Select col from tbl_test',conn); Dataset ds = new DataSet; da.fill(ds,"tab"); DataTable dt = new DataTable(); dt = ds.table(0); DataRow dr = DataRow(); for each dr in dt.rows Messagebox.show(dr.row[o].ToString()); next
sorry man... more errors in your coding... 1. we cant user DataRow dr=DataRow(); 2. there is no messagebox.show in asp.net 2.0 Can anyone help me plz? i needed : i have set of values in my dataset and i want to create new row in datatable and insert the dataset value one by one. i.e., if dataset consist of 10 values, then ten rows is to be created and the row[0].column[0] to row[9].column[0] should contain the dataset values.
-
when i run the below coding i m getting the error 'System.Data.DataRow.DataRow(System.Data.DataRowBuilder)' is inaccessible due to its protection level help me... the coding is below.. DataTable dttable = new DataTable(); DataRow dtrow; DataColumn dtCol; sqlda = new System.Data.SqlClient.SqlDataAdapter("select col from tbl_test", conn); sqlda.Fill(ds); if (ds.Tables[0].Rows.Count != 0) { for (int i = 0; i<ds.tables[0].rows.count;> { dtrow = new DataRow("" + ds.Tables[0].Rows[i][0].ToString() + ""); dttable.Rows.Add(dtrow); } }
check these links out: http://forums.devshed.com/net-development-87/protection-level-problem-410561.html http://forums.msdn.microsoft.com/en-US/csharpgeneral/thread/addf82a2-9378-4dd0-bb4a-a40b8582bf62/
The answers posted by me are suggestions only and cannot be used in anyway against me.