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. How to convert System.Web.UI.WebControls.Table into System.Data.DataTable ?

How to convert System.Web.UI.WebControls.Table into System.Data.DataTable ?

Scheduled Pinned Locked Moved ASP.NET
designhelptutorialquestion
5 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
    K V Sekhar
    wrote on last edited by
    #1

    Hi all, How to convert System.Web.UI.WebControls.Table into System.Data.DataTable ? i tried it by System.Web.UI.WebControls.Table t=new System.Web.UI.WebControls.Table(); System.Data.DataTable dt = new System.Data.DataTable(); dt = (System.Data.DataTable)t; Its giving Error. Error 9 Argument '1': cannot convert from 'System.Web.UI.WebControls.Table' to 'System.Data.DataTable' Please suggest me how to do that. Thanks in advance.

    K P 2 Replies Last reply
    0
    • K K V Sekhar

      Hi all, How to convert System.Web.UI.WebControls.Table into System.Data.DataTable ? i tried it by System.Web.UI.WebControls.Table t=new System.Web.UI.WebControls.Table(); System.Data.DataTable dt = new System.Data.DataTable(); dt = (System.Data.DataTable)t; Its giving Error. Error 9 Argument '1': cannot convert from 'System.Web.UI.WebControls.Table' to 'System.Data.DataTable' Please suggest me how to do that. Thanks in advance.

      K Offline
      K Offline
      Kannan Ar
      wrote on last edited by
      #2

      There is no direct method for that. You have to implement a loop to copy values.

      K 1 Reply Last reply
      0
      • K K V Sekhar

        Hi all, How to convert System.Web.UI.WebControls.Table into System.Data.DataTable ? i tried it by System.Web.UI.WebControls.Table t=new System.Web.UI.WebControls.Table(); System.Data.DataTable dt = new System.Data.DataTable(); dt = (System.Data.DataTable)t; Its giving Error. Error 9 Argument '1': cannot convert from 'System.Web.UI.WebControls.Table' to 'System.Data.DataTable' Please suggest me how to do that. Thanks in advance.

        P Offline
        P Offline
        Prasanna Kumar Pete
        wrote on last edited by
        #3

        if you are trying to display the data in the page then use datagrid

        Thanks & Regards Pete

        K 1 Reply Last reply
        0
        • K Kannan Ar

          There is no direct method for that. You have to implement a loop to copy values.

          K Offline
          K Offline
          K V Sekhar
          wrote on last edited by
          #4

          Thanks for your reply

          1 Reply Last reply
          0
          • P Prasanna Kumar Pete

            if you are trying to display the data in the page then use datagrid

            Thanks & Regards Pete

            K Offline
            K Offline
            K V Sekhar
            wrote on last edited by
            #5

            Thanks for your reply.

            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