.NET FeatureReader and MySQL FDO provider

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

.NET FeatureReader and MySQL FDO provider

George McLean
Hello,

I have written an application in .NET that queries a database using an
FDO provider. The application works well when I use the
Autodesk.SqlServer3.1 provider but does some strange things when I use
the OSGeo.MySQL.3.1 provider or the OSGeo.MySQL.3.2 driver.

Specifically, I am having trouble with the GetString method in a
FeatureReader object. When I query data from MySql and loop through the
data set, the GetString method does not appear to clear out the values
from the previous record for the given field. If I have two records with
values of 'ABCDEF' and 'XYZ', the first pass through the loop will set
the value of strValue to 'ABCDEF' but the second pass yields 'XYZDEF'.
It looks like some sort of buffer is not getting cleared and I am
guessing it is in the MySQL provider. This code works correctly with SQL
Server. Any suggestions?

       Dim DataReader As Autodesk.Gis.Fdo.Commands.Feature.IFeatureReader
      .................
           DataReader = FdoSelectCmd.Execute()
           While DataReader.ReadNext() = True
                   strValue = ""
                   If DataReader.IsNull("a_text_field") Then
                       strValue = "none"
                   Else
                       strValue = DataReader.GetString("a_text_field")
                   End If
         End While

Thanks

George McLean

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: .NET FeatureReader and MySQL FDO provider

Robert Fortin
George,

Dan Stoica has reproduced the problem and log a defect against the MySQL
provider.
We will look into fixing this issue.  We will keep you in the loop when
the fix is available.

Thanks for finding this one!

RF

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of George McLean
Sent: Saturday, January 13, 2007 7:59 PM
To: [hidden email]
Subject: [fdo-users] .NET FeatureReader and MySQL FDO provider

Hello,

I have written an application in .NET that queries a database using an
FDO provider. The application works well when I use the
Autodesk.SqlServer3.1 provider but does some strange things when I use
the OSGeo.MySQL.3.1 provider or the OSGeo.MySQL.3.2 driver.

Specifically, I am having trouble with the GetString method in a
FeatureReader object. When I query data from MySql and loop through the
data set, the GetString method does not appear to clear out the values
from the previous record for the given field. If I have two records with
values of 'ABCDEF' and 'XYZ', the first pass through the loop will set
the value of strValue to 'ABCDEF' but the second pass yields 'XYZDEF'.
It looks like some sort of buffer is not getting cleared and I am
guessing it is in the MySQL provider. This code works correctly with SQL
Server. Any suggestions?

       Dim DataReader As
Autodesk.Gis.Fdo.Commands.Feature.IFeatureReader
      .................
           DataReader = FdoSelectCmd.Execute()
           While DataReader.ReadNext() = True
                   strValue = ""
                   If DataReader.IsNull("a_text_field") Then
                       strValue = "none"
                   Else
                       strValue = DataReader.GetString("a_text_field")
                   End If
         End While

Thanks

George McLean

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users