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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
HI Chris,

How is your dataadapter configured?

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

Chris said:
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".
 
Back
Top