2nd Repost: Problem Retrieving DataSet Returned By A WebService... anyone from Microsoft or anyone w

P

Programatix

Hi,

I'm working on a project which includes WebServices and Windows Form
application.

The Windows Form application will call the WebServices to retrieve data from
database. The data will be returned as DataSet.

Now, here's the problem. On .NET Framework 1.1, if any rows in the dataset
returned contain errors (marked by calling the SetColumnError() method or
setting the RowError property of the DataRow), I get the following error
message in the Windows Form application,

"There is an error in XML doument (1,xxxxxxx)"

If I forced the Windows Form application to run on .NET Framework 1.0,
everything works fine.

Is this a bug? Or I need to make some code adjustment because of changes to
the Framework?

Here's the partial code for the WebService project

Code:

<WebMethod()> _
Public Function RetrieveDataSet() As DataSet
Dim ds As New DataSet
Dim dt As New DataTable
Dim row As DataRow
Dim i As Integer

dt.TableName = "TestTable"
dt.Columns.Add("TestColumn1", GetType(String))
dt.Columns.Add("TestColumn2", GetType(Integer))

ds.DataSetName = "TestDataSet"
ds.Tables.Add(dt)

For i = 0 To 10
row = dt.NewRow
row("TestColumn1") = "This is row " & i
row("TestColumn2") = i
dt.Rows.Add(row)

' The following code trigger the error after the DataSet
' is returned to the calling Window Form application
row.SetColumnError("TestColumn1", "Error message here")
Next

Return ds
End Function



For the Windows Form application, you need to insert a datagrid control
(assumed as datagrid1). It will look something like this,

Code:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim ws As localhost.Service1
Dim ds As DataSet

Try
ws = New localhost.Service1
ds = ws.RetrieveDataSet

Me.DataGrid1.SetDataBinding(ds.Tables(0), "")
Catch ex As Exception
MsgBox(ex.Message)
Finally
If (Not (ws Is Nothing)) Then
ws.Dispose()
End If
End Try
End Sub


I really hope someone could help me out with this one.

Thanks in advance.

ps: Please, before anyone reply to state that I did not choose the
appropriate groups when making this post a crossposts post, please know that
I'm currently in blind on what is causing this error. Is it the WebService?
or is it the ADO .Net? or is it Windows Form application? or is it VB .Net?
Well, it has something to do with WebService as it only happens to the
DataSet returned by WebService. It also has something to do with ADO .Net as
I'm using DataSet. And it definitely has something to do with Windows Form
application as if I force the Windows Form application project to run on
..Net Framework 1.0, everything works fine.
 
J

Jorge Ribeiro

I'm almost sure the problem is with serialization of the dataset. When you
try to serialize a dataset with row errors, it will give you that error. So,
the problem is not specific to webservices. I think it's a bug in .NET
framework 1.1. I've posted about this issue also (and read others posts
regarding this also) and got no response from MS guys.

I read somewhere (don't remember the newsgroup) a post from someone saying
that MS has already admitted (not officially) it was a bug and it would be
solved in next service pack, but I couldn't confirm that information, as I
didn't see any post from Microsoft.

I hope Microsoft will provide us with some sort of fix or workaround to this
problem and I hope they at least respond to these growing number of posts
regarding this issue.



Sorry if MS already responded to this matter, but I've spent so many time in
searches regarding this and found nothing official!





Thanks,



Jorge Ribeiro
 
P

Programatix

I'm sure agree with you. I have so far sent this same post to 3 Microsoft's
support guys and their never respond back to my post. Sigh...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top