473,396 Members | 1,724 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,396 software developers and data experts.

binding XML data to the datalist control

Hi,

I managed to save the XML data into the database and retrieve it from the
database. I have the following problem. When I bind the XML data, which I
have read from the database, to the datalist control, following error
message appears:
DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with
the name ExchangeRate.
Exception Details: System.Web.HttpException: DataBinder.Eval:
'System.Data.DataRowView' does not contain a property with the name
ExchangeRate.

Source Error:
Line 89: <TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.InvoiceNo") %></TD>
Line 90: <TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.InvoiceDate", "{0:d}") %></TD>
Line 91: <TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.ExchangeRate") %></TD>
Line 92: <TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.WithoutUs", "{0:n}") %></TD>
Line 93: <TD align="right" width="10%"><%# Databinder.Eval(Container,
"DataItem.Difference", "{0:n}") %></TD>

I am using the following code blocks:

Dim strXML As String
strXML = myDataSet.Tables(0).Rows(0).Item("XMLData")

Dim strReader As System.IO.StringReader
strReader = New System.IO.StringReader(strXML)

ds.ReadXml(strReader)

dliHospCosts.DataSource = ds
dliHospCosts.DataMember = "HospCosts"
dliHospCosts.DataBind()

I am using the following code snippet to save the XML data as text into the
database:

Private Sub btnSaveCP_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSaveCP.Click

ds = ViewState("ds")
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)
myCommand.Parameters.Add("@totalAmount", CalculateTotalAmount())
myCommand.Parameters.Add("@totalAmountCurrency", lblCurTotal.Text)
myCommand.Parameters.Add("@createdOn", Date.Now)
myCommand.Parameters.Add("@createdBy", Session("employeeId"))
'Girilen yazıları da kaydedelim
myCommand.Parameters.Add("@enteredICAddress",
Server.UrlEncode(txtICAddress.Text))
myCommand.Parameters.Add("@enteredClientName", txtClientName.Text)
If Request.Form.Get("txtItemDesc") <> "" Then
myCommand.Parameters.Add("@enteredItemDesc",
Request.Form.Get("txtItemDesc"))
End If
If Request.Form.Get("txtItem") <> "" Then
myCommand.Parameters.Add("@enteredItem",
Request.Form.Get("txtItem"))
End If
myCommand.Parameters.Add("@enteredDate", CType(txtDate.Text, Date))

myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()

End Sub

How can I solve this? Thanks in advance,

Buran
Nov 19 '05 #1
0 723

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

Similar topics

0
by: ani | last post by:
Hi, I have a datalist control and within the Itemplate I have a radiobuttonlist control . I am binding data to the datalist control in Page_load . Also I have sqldatareader object that needs...
3
by: bbernieb | last post by:
Hi, All, Is it possible to access a variable inside of a data binding, without the variable being out of scope? (Note: On the DataBinder line, I get an error message that says "Name 'i' is...
5
by: somequestion | last post by:
< uc1:BoardWrite ID="BoardWrite1" CommentId="<%# Eval("CommentId") %>" runat="server" /> this is visual studio 2005 asp.net tag. first it's nor working..but i need this because i will use this...
2
by: Trey Bean | last post by:
I'm new to ASP.NET, but have been asked to create an ASP.NET app that retrieves data from a third-party web service. I've managed to connect and retrieve the data from the web service, but am...
0
by: diff | last post by:
I am having trouble preventing a bound source from updating using event-driven validation. There is a very nice article on MSDN explaining this;...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.