Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Datatable error in asp.net... help me!

Datatable error in asp.net... help me!

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-net
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Karan_TN
    wrote on last edited by
    #1

    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); } }

    B E 2 Replies Last reply
    0
    • K Karan_TN

      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); } }

      B Offline
      B Offline
      Bhim Prakash Singh
      wrote on last edited by
      #2

      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

      K 1 Reply Last reply
      0
      • B Bhim Prakash Singh

        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

        K Offline
        K Offline
        Karan_TN
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • K Karan_TN

          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); } }

          E Offline
          E Offline
          eyeseetee
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups