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. General Programming
  3. .NET (Core and Framework)
  4. how to bind gridview using

how to bind gridview using

Scheduled Pinned Locked Moved .NET (Core and Framework)
questioncssdatabasexmltutorial
2 Posts 2 Posters 1 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.
  • N Offline
    N Offline
    nileshbahirshet
    wrote on last edited by
    #1

    I am devloping an application in which I wan to bind gridview using xml data which comes from database .. How can I bind the gridview using SqlAdapter and dataset objects ? I have following code but it doesnt make column as per xml data in grid view It shows all data into single column .. I dont know whether I am make some mistake in inserting or retrving the data... Whether I have to store the xml as document type or as storage type ? I have following code which I use to bind the grid view ... Dim sqlString As String = "Data Source=ADSERVER\..........." Dim sqlConnection As New SqlConnection(sqlString) Dim xr As Xml.XmlReader Dim ds2 As New DataSet Dim dt As DataTable sqlConnection.Open() Dim cmd As New SqlCommand("Select data from xmlTest where PKID=63", sqlConnection) xr = cmd.ExecuteXmlReader() ds2.ReadXml(xr, XmlReadMode.InferSchema) dt = ds2.Tables(0) VGridControl1.DataSource = dt Which displays the in the single column as it is in database...

    B 1 Reply Last reply
    0
    • N nileshbahirshet

      I am devloping an application in which I wan to bind gridview using xml data which comes from database .. How can I bind the gridview using SqlAdapter and dataset objects ? I have following code but it doesnt make column as per xml data in grid view It shows all data into single column .. I dont know whether I am make some mistake in inserting or retrving the data... Whether I have to store the xml as document type or as storage type ? I have following code which I use to bind the grid view ... Dim sqlString As String = "Data Source=ADSERVER\..........." Dim sqlConnection As New SqlConnection(sqlString) Dim xr As Xml.XmlReader Dim ds2 As New DataSet Dim dt As DataTable sqlConnection.Open() Dim cmd As New SqlCommand("Select data from xmlTest where PKID=63", sqlConnection) xr = cmd.ExecuteXmlReader() ds2.ReadXml(xr, XmlReadMode.InferSchema) dt = ds2.Tables(0) VGridControl1.DataSource = dt Which displays the in the single column as it is in database...

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      Have you checked you dt,That it is having single column as DB or according to your XML schema?

      Cheers!! Brij

      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