Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Datagrid is not displayed with XML

Reply
Thread Tools

Datagrid is not displayed with XML

 
 
krallabandi@gmail.com
Guest
Posts: n/a
 
      11-25-2005
Hi.


I use two different approaches to bind data to my DataGrid. One is to
get
the data from a database, like this:


oleDbDataAdapter = New OleDbDataAdapter(strSqlCostItem,
oleDbConnection)
oleDbDataAdapter.Fill(dataSet, "ITEM")
dgItem.DataSource = dataSet.Tables("ITEM")
dgItem.DataBind()


The other approach is to use xml, like this:


byteXml = myWebService.ReturnXmlAsByte()
memoryStream = New MemoryStream(byteXml)
dataSetLocal = New DataSet()
dataSetLocal.ReadXml(memoryStream)
dgItem.DataSource = dataSetLocal.Tables("ITEM")
dgItem.DataBind()


With the first approach the DataGrid is visible even if the sql returns
no
records from the DB. No records are displayed, but all the column's
headertext are showing. But if the webservice returns just an empty
node the
DataGrid doesn't show at all. How can I make it show? Can I format
the xml
a certain way? I've tried having all the elements there, but without
any
data. That didn't work, it showed an empty record in the DataGrid, and
I
don't want an empty record. I just want the headertext to show.


Thanks,

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Japanese Text not displayed on Image Generated by Servlet on winXP, Linux but displayed on Win2000 boney Java 1 12-15-2006 02:24 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Need query value not displayed in DataGrid Anna ASP .Net 1 02-26-2005 09:42 PM
Swedish characters not displayed in datagrid Wes-Securitas ASP .Net Datagrid Control 0 07-19-2004 08:58 PM
How to know if a datagrid item will be displayed in a datagrid with pagging CFirmino ASP .Net Datagrid Control 1 04-04-2004 12:39 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57