B
buran
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>
<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
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>
<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