DataGrid wont show

S

Shawn

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,

Shawn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top