So I've got a result set coming back that consists of 4 columns "name", "source", "sourcePath", and "Total". What happens is that the data in the sourcePath column is lost and replaced with the data from the "source" column. Further, the column formerly known as "sourcePath" is now "source1".

I discovered this when filling a dataset using a SqlDataAdapter. I then tried using a SqlDataReader with the same result excepting that the "sourcePath" column was named "source" so that there were a total of 2 "source" columns. (I'm guessing that the dataSet ensures column name uniquess by appending the "1"). When running the sproc with the same parameters in QueryAnalyzer it returns fine (all columns named and filled as they should be). I checked my sproc parameters before and after the filling of the dataset to make sure that those were being corrupted and those appear fine as well.

I also tried rearranging the order that the columns are returned in so that the "sourcePath" column was not directly after the "source" column but this had no effect. Likewise when I had the "sourcePath" column returned before the "source" column. It seems to strip the "Path" from "sourcePath".

Has anyone seen this?

Re: BUG? Ado is corrupting a result set when two of the columns have the similar names by Miha

Miha
Fri Feb 06 03:45:50 CST 2004

HI Chris,

How is your dataadapter configured?

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Chris" <clande@_nospam_eedinc._nospam_com> wrote in message
news:E4606A93-D22F-43BE-A6A8-F95A05FC33BB@microsoft.com...
> So I've got a result set coming back that consists of 4 columns "name",
"source", "sourcePath", and "Total". What happens is that the data in the
sourcePath column is lost and replaced with the data from the "source"
column. Further, the column formerly known as "sourcePath" is now "source1".
>
> I discovered this when filling a dataset using a SqlDataAdapter. I then
tried using a SqlDataReader with the same result excepting that the
"sourcePath" column was named "source" so that there were a total of 2
"source" columns. (I'm guessing that the dataSet ensures column name
uniquess by appending the "1"). When running the sproc with the same
parameters in QueryAnalyzer it returns fine (all columns named and filled as
they should be). I checked my sproc parameters before and after the filling
of the dataset to make sure that those were being corrupted and those appear
fine as well.
>
> I also tried rearranging the order that the columns are returned in so
that the "sourcePath" column was not directly after the "source" column but
this had no effect. Likewise when I had the "sourcePath" column returned
before the "source" column. It seems to strip the "Path" from "sourcePath".
>
> Has anyone seen this?