PC Review


Reply
Thread Tools Rate Thread

binding XML data to the datalist control

 
 
buran
Guest
Posts: n/a
 
      28th Apr 2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document? Daniel Microsoft Dot NET Framework 5 17th Mar 2007 10:11 AM
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document? Daniel Microsoft Dot NET 1 15th Mar 2007 10:37 AM
Binding DataList to XML paulsmith5@hotmail.com Microsoft ASP .NET 0 14th Dec 2005 06:18 PM
Binding DataList to XML paulsmith5@hotmail.com Microsoft Dot NET 0 14th Dec 2005 06:18 PM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll Microsoft ASP .NET 8 9th Sep 2004 11:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:23 AM.