Solved

asp.net datagrid.databind() to xml result set?

Posted on 2010-08-20
4
553 Views
Last Modified: 2013-11-15
so i have a working application that calls a stored proc and binds to the data set that is returned.

i want to use select * from table for auto xml

or something that would return XML and want to have the data grid bind to that without me having to do things manually.

any advice on how to get this done?
0
Comment
Question by:realcoding
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Expert Comment

by:Om Prakash
ID: 33484477
0
 

Author Comment

by:realcoding
ID: 33484518
on the SQL side how do i get my stored proc to return XML in teh correct format for the .net side fo things to be able to use the xml data easily?

lets say now i have the following SQL

select empID, empName, empAge from Employee

and there are ten records in the table?
0
 

Author Comment

by:realcoding
ID: 33484636
below is the xml that is created when i add a "for xml auto" to my select.
the datagrid.databind() fails not being able to find fields (attributes of sub nodes. the one it fails on is MilestoneText)

<pm ProjectMilestoneId="100" ProjectId="2" MilestoneCID="18" StartDate="2010-08-18T00:00:00" EndDate="2010-08-19T00:00:00" RAGStatusCID="7" CompletionStatusCID="32" StatusText="something more wicked this way comes" Added="2010-08-16T00:00:00" LastUpdate="2010-08-18T14:06:26.510" UpdateBy="AMRS\ssalvati">
  <pm1sc MilestoneText="SAD/LLD Due                                       ">
    <pm2sc RAGStatusText="Red                                               ">
      <pm3sc CompletionStatusText="In-Progress                                       " />
    </pm2sc>
  </pm1sc>
</pm>
<pm ProjectMilestoneId="99" ProjectId="2" MilestoneCID="19" StartDate="1988-05-16T00:00:00" EndDate="2011-01-01T00:00:00" RAGStatusCID="7" CompletionStatusCID="35" StatusText="something really good is about to happen" ReportingPriority="1" Added="2010-08-10T00:00:00" LastUpdate="2010-08-18T11:04:09.660" UpdateBy="AMRS\ssalvati">
  <pm1sc MilestoneText="Hardware Required                                 ">
    <pm2sc RAGStatusText="Red                                               ">
      <pm3sc CompletionStatusText="Cancelled                                         " />
    </pm2sc>
  </pm1sc>
</pm>
<pm ProjectMilestoneId="991" ProjectId="2" MilestoneCID="1" StartDate="1933-05-16T00:00:00" EndDate="2033-01-01T00:00:00" RAGStatusCID="7" CompletionStatusCID="33" StatusText="testing text11111" Added="2010-08-10T00:00:00" LastUpdate="2010-08-17T18:44:31.813" UpdateBy="mshinder">
  <pm1sc MilestoneText="High                                              ">
    <pm2sc RAGStatusText="Red                                               ">
      <pm3sc CompletionStatusText="Delayed                                           " />
    </pm2sc>
  </pm1sc>
</pm>

Open in new window

0
 

Accepted Solution

by:
realcoding earned 0 total points
ID: 33504080
using xml raw does what i need, it gets all the fields in the select as attributes to a single node. the grid binds to this xml just fine.
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question