xml, dataset, datalist

Discussion in 'ASP .Net Web Controls' started by buran, Apr 29, 2005.

  1. buran

    buran Guest

    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
    buran, Apr 29, 2005
    #1
    1. Advertising

  2. buran

    buran Guest

    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" <> wrote in message
    news:...
    > 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
    >
    >
    buran, Apr 29, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gönen EREN

    Datalist in Datalist How?

    Gönen EREN, Aug 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    399
    Gönen EREN
    Aug 22, 2003
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,849
  3. buran

    xml, dataset, datalist

    buran, Apr 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,463
    buran
    Apr 29, 2005
  4. Replies:
    0
    Views:
    428
  5. ringo
    Replies:
    0
    Views:
    161
    ringo
    Aug 18, 2004
Loading...

Share This Page