Rahul Khanna

Rahul Khanna

  • NA
  • 236
  • 0

Unexpected results in select query and in dataset.

May 9 2011 1:37 PM

 Hi all Legend,

Today I observed some awkward behaviour of select query and dataset. With just simple query I am getting all the values from one field and displaying that in dataset. But while filling in dataset it is not the same values which are there in actual database table.

For example Table name is Testable: Field is Field1(varchar), values there in this fields are:

 

Field1

000-00010-00

000-00020-00

000-00030-00

………….etc

while I am writing the query from C# like below:

Command.Text="select Field1 from Testable"

And filling this in DataSet obect,before filling the dataset I am resetting the dataset too.

But values comings are wrong:

Its coming like:

000-0001-00

000-0002-00

000-0003-00

…….etc.

 

I have debugged my code, everything is correct, its pointing to correct database, correct table, correct query but wrong values. how come is this possible?? I am not getting any idea…or not getting clues. could somebody pls help me out  what could be the possible reason for this bug?????


Answers (2)