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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Import DataRow into DataTable

Import DataRow into DataTable

Scheduled Pinned Locked Moved ASP.NET
csharpquestionasp-netsysadminxml
3 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.
  • C Offline
    C Offline
    codingrocks
    wrote on last edited by
    #1

    i am doing an application, in which i want to search records from dataset. after this i want to bind data to datatable from a datarow. the code i used was DataSet dsSearch = new DataSet(); dsSearch.ReadXml(Server.MapPath("~/XMLFiles/Users.xml")); DataRow[] dRow = dsSearch.Tables[0].Select("Name='" + txtName.Text + "'"); DataTable dTable = new DataTable(); after this how can i import the dRow into a datatable or dataset and bind it... any help would be appreciated....?

    SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

    C N 2 Replies Last reply
    0
    • C codingrocks

      i am doing an application, in which i want to search records from dataset. after this i want to bind data to datatable from a datarow. the code i used was DataSet dsSearch = new DataSet(); dsSearch.ReadXml(Server.MapPath("~/XMLFiles/Users.xml")); DataRow[] dRow = dsSearch.Tables[0].Select("Name='" + txtName.Text + "'"); DataTable dTable = new DataTable(); after this how can i import the dRow into a datatable or dataset and bind it... any help would be appreciated....?

      SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      An array of datarows is a valid data source, so you don't need the datatable.

      Christian Graus Driven to the arms of OSX by Vista.

      1 Reply Last reply
      0
      • C codingrocks

        i am doing an application, in which i want to search records from dataset. after this i want to bind data to datatable from a datarow. the code i used was DataSet dsSearch = new DataSet(); dsSearch.ReadXml(Server.MapPath("~/XMLFiles/Users.xml")); DataRow[] dRow = dsSearch.Tables[0].Select("Name='" + txtName.Text + "'"); DataTable dTable = new DataTable(); after this how can i import the dRow into a datatable or dataset and bind it... any help would be appreciated....?

        SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

        N Offline
        N Offline
        Nishant Singh
        wrote on last edited by
        #3

        You can implement like this You have to loop thru DataRow array and add Like this

        DtaRow dr=dRow[index]
        dTable.Rows.Add[dRow[index]]

        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