Hi,
First of all, thank you for your help. I think, 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.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
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:
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
'on another page
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()
How can I solve this? Thanks in advance,
Buran