Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Hello,
my datatable returns a row with several fields.
I can refer to all the field values except one of them which returns blank.
In immediate window it returns : dt.Rows[0]["Quarter"]
{}
Even if I refer to it by index number, it returns the same thing i.e. empty value
 
I can see in the stored proc it does return a value for field "Quarter"
 
Do you know what I am doing wrong?
Posted 16-Jan-13 23:27pm
arkiboys2.6K
Comments
OriginalGriff at 17-Jan-13 4:40am
   
Without your code? No idea!
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Try posting the relevant code fragments to load the DT and access the fields.
If you are using an SP, then that would probably help as well.
Use the "Improve question" widget to edit your question and provide better information.
k.Prathap at 17-Jan-13 4:42am
   
post your code
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

In immediate window it returns : dt.Rows[0]["Quarter"]
{}
it means dt.Rows[0]["Quarter"] contains null value.
see in table and check the value.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Solved by changing the datatype.
Not sure why.
Thank anyway.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,534
1 OriginalGriff 6,258
2 Peter Leow 2,534
3 Maciej Los 2,308
4 Abhinav S 2,274


Advertise | Privacy | Mobile
Web03 | 2.8.150414.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100