473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

xml, dataset, datalist

Dear ASP.NET Programmers,

I need your help on the following case:
1. I have a page coverpage.aspx, on which I load invoice data into the
datalist control dliHospCosts. I use the stored procedure spGetHospAmounts
and load the data.

<ItemTemplate>
<TABLE id="Table77" width="100%">
<TR>
<td align="left" width="7%" valign="top">
<asp:button id="btnEditItemHosp" runat="server" Text="Edit"
CommandName="edit"></asp:button>&nbsp;
<asp:LinkButton id="lnkDeleteItemHosp" runat="server"
CausesValidation="False" CommandName="delete">Delete</asp:LinkButton></td>
<TD align="left">
<UL>
<LI>
<%# Databinder.Eval(Container, "DataItem.SPName") %>
</LI>
</UL>
</TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.InvoiceNo") %></TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.InvoiceDate", "{0:d}") %></TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.ExchangeRate") %></TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.WithoutUs", "{0:n}") %></TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.Difference", "{0:n}") %></TD>
<TD align="right" width="10%" bgcolor="Gainsboro"><%#
Databinder.Eval(Container, "DataItem.InvoiceAmount", "{0:n}") %></TD>
</TR>
</TABLE>
</ItemTemplate>

2. I get XML string from the dataset ds and save it into a file burak.xml
and into the database as ntext.

ds.WriteXml("C:\Inetpub\wwwroot\database2\richtext \burak.xml")

Dim strXML As String

strXML = ds.GetXml

strSql = "spNewCoverPage"

myCommand.CommandText = strSql

myCommand.CommandType = CommandType.StoredProcedure

myCommand.Parameters.Clear()

myCommand.Parameters.Add("@ourFileNo", Session("selectedFileNumber"))

myCommand.Parameters.Add("@xMLData", strXML)

..

..

3. Following is the contents of the burak.xml: This is also saved in the
database as ntext.

<?xml version="1.0" standalone="yes" ?>

- <NewDataSet>
- <OtherCosts>
<ActionDesc>Airplane Ticket Arrangement</ActionDesc>
<InPrice>548</InPrice>
<InPriceCur>EUR</InPriceCur>
<OutPrice>630</OutPrice>
<OutPriceCur>EUR</OutPriceCur>
<ActionTypeID>6</ActionTypeID>
<ActionID>1001</ActionID>
</OtherCosts>
- <OtherCosts>
<ActionDesc>Airplane Ticket Arrangement</ActionDesc>
<InPrice>442</InPrice>
<InPriceCur>EUR</InPriceCur>
<OutPrice>543</OutPrice>
<OutPriceCur>EUR</OutPriceCur>
<ActionTypeID>6</ActionTypeID>
<ActionID>1003</ActionID>
</OtherCosts>
- <OtherCosts>
<ActionDesc>Ground Ambulance</ActionDesc>
<InPrice>108</InPrice>
<InPriceCur>EUR</InPriceCur>
<OutPrice>200</OutPrice>
<OutPriceCur>EUR</OutPriceCur>
<ActionTypeID>1</ActionTypeID>
<ActionID>1005</ActionID>
</OtherCosts>
- <OtherCosts>
<ActionDesc>Hotel Reservation</ActionDesc>
<InPrice>20</InPrice>
<InPriceCur>YTL</InPriceCur>
<OutPrice>30</OutPrice>
<OutPriceCur>EUR</OutPriceCur>
<ActionTypeID>9</ActionTypeID>
<ActionID>1006</ActionID>
</OtherCosts>
</NewDataSet>

4. I want to load the XML string from the database into the datalist control
dliHospCosts (same as the one on the coverpage.aspx) on another page
coverpage_generated.aspx. Since, the XML does not have a tag named
ExchangeRate (beacuse it was null), I receive the following error:

DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with
the name ExchangeRate

I hope that I could explain my problem. Thanks in advance,

Buran
Nov 19 '05 #1
1 1315
Oops, I pasted the wrong XML. The correct one should be the following:

<?xml version="1.0" standalone="yes" ?>
- <NewDataSet>
- <HospCosts>
<InvoiceAmount>483.2400</InvoiceAmount>
<CurrencyOriginal>EUR</CurrencyOriginal>
<OurFileNo>M05000199</OurFileNo>
<SPName>BİLGİ HASTANESİ</SPName>
<InvoiceDate>2005-04-11T00:00:00.0000000+03:00</InvoiceDate>
<InvoiceNo>037029</InvoiceNo>
<WithoutUs>589.9400</WithoutUs>
<Difference>106.7000</Difference>
</HospCosts>
</NewDataSet>
"buran" <b@b.com> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...
Dear ASP.NET Programmers,

I need your help on the following case:
1. I have a page coverpage.aspx, on which I load invoice data into the
datalist control dliHospCosts. I use the stored procedure spGetHospAmounts
and load the data.

<ItemTemplate>
<TABLE id="Table77" width="100%">
<TR>
<td align="left" width="7%" valign="top">
<asp:button id="btnEditItemHosp" runat="server" Text="Edit"
CommandName="edit"></asp:button>&nbsp;
<asp:LinkButton id="lnkDeleteItemHosp" runat="server"
CausesValidation="False" CommandName="delete">Delete</asp:LinkButton></td>
<TD align="left">
<UL>
<LI>
<%# Databinder.Eval(Container, "DataItem.SPName") %>
</LI>
</UL>
</TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.InvoiceNo") %></TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.InvoiceDate", "{0:d}") %></TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.ExchangeRate") %></TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.WithoutUs", "{0:n}") %></TD>
<TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.Difference", "{0:n}") %></TD>
<TD align="right" width="10%" bgcolor="Gainsboro"><%#
Databinder.Eval(Container, "DataItem.InvoiceAmount", "{0:n}") %></TD>
</TR>
</TABLE>
</ItemTemplate>

2. I get XML string from the dataset ds and save it into a file burak.xml
and into the database as ntext.

ds.WriteXml("C:\Inetpub\wwwroot\database2\richtext \burak.xml")

Dim strXML As String

strXML = ds.GetXml

strSql = "spNewCoverPage"

myCommand.CommandText = strSql

myCommand.CommandType = CommandType.StoredProcedure

myCommand.Parameters.Clear()

myCommand.Parameters.Add("@ourFileNo", Session("selectedFileNumber"))

myCommand.Parameters.Add("@xMLData", strXML)

.

.

3. Following is the contents of the burak.xml: This is also saved in the
database as ntext.

<?xml version="1.0" standalone="yes" ?>

- <NewDataSet>
- <OtherCosts>
<ActionDesc>Airplane Ticket Arrangement</ActionDesc>
<InPrice>548</InPrice>
<InPriceCur>EUR</InPriceCur>
<OutPrice>630</OutPrice>
<OutPriceCur>EUR</OutPriceCur>
<ActionTypeID>6</ActionTypeID>
<ActionID>1001</ActionID>
</OtherCosts>
- <OtherCosts>
<ActionDesc>Airplane Ticket Arrangement</ActionDesc>
<InPrice>442</InPrice>
<InPriceCur>EUR</InPriceCur>
<OutPrice>543</OutPrice>
<OutPriceCur>EUR</OutPriceCur>
<ActionTypeID>6</ActionTypeID>
<ActionID>1003</ActionID>
</OtherCosts>
- <OtherCosts>
<ActionDesc>Ground Ambulance</ActionDesc>
<InPrice>108</InPrice>
<InPriceCur>EUR</InPriceCur>
<OutPrice>200</OutPrice>
<OutPriceCur>EUR</OutPriceCur>
<ActionTypeID>1</ActionTypeID>
<ActionID>1005</ActionID>
</OtherCosts>
- <OtherCosts>
<ActionDesc>Hotel Reservation</ActionDesc>
<InPrice>20</InPrice>
<InPriceCur>YTL</InPriceCur>
<OutPrice>30</OutPrice>
<OutPriceCur>EUR</OutPriceCur>
<ActionTypeID>9</ActionTypeID>
<ActionID>1006</ActionID>
</OtherCosts>
</NewDataSet>

4. I want to load the XML string from the database into the datalist control dliHospCosts (same as the one on the coverpage.aspx) on another page
coverpage_generated.aspx. Since, the XML does not have a tag named
ExchangeRate (beacuse it was null), I receive the following error:

DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name ExchangeRate

I hope that I could explain my problem. Thanks in advance,

Buran

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Whitfield | last post by:
Hi All - I am an experienced ASP developer but am new to ASP.NET and the .NET framework and am trying to learn how to access datasets. When I try to build the following page, I get the errow...
1
by: buran | last post by:
Dear ASP.NET Programmers, I need your help on the following case: 1. I have a page coverpage.aspx, on which I load invoice data into the datalist control dliHospCosts. I use the stored procedure...
1
by: Iwan Petrow | last post by:
Hi, I have an instance of dataset which is filled. I show part of the data in a datagrid (in the future the user will choose which columns to be shown). Now I would like to put all information...
4
by: Moojjoo | last post by:
Ok fellow C# developers: How do creat an instance of an object inside a dataset or datagrid. Example I need to have a placeholder inside a dataset. Any help would be great.
3
by: Ben Becker | last post by:
I am trying to build a custom crosstab type of grid where I take some items in a data grid and based on the content of the current item compared to the previous item, determine if a new row in a...
7
by: Mike | last post by:
I'm trying to filter a dataset on items that are being passed in via a querystring. the string looks like this. chevy|ford|BMW| on the information page i split the string such as...
2
by: Alex S Moore | last post by:
I built a dataset with two datatables and added the relation. The example in the help text for datatable class seemed sufficient. Binding a datalist using the dataset for datasource and the...
5
by: Aahz | last post by:
Hello; I have an XML file with data which I show in DataList sucessfully, using DataSet Problem is that XML has about 30 records which is too much I need to show just first 10 ordered by date...
1
by: Patricio | last post by:
Hello all I have a form that contains several textbox. I have also a DataSet that contains the Fill function by ID. How can I assign the DataSet values into my TextBox? Thanks a lot.
4
by: Per W. | last post by:
Hi, how can i check one spesific item in a dataset and then hide that item if there isnt any data in it? in a gridview i can use e.row.cells(1).text to read the value, but how can i read one item...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.