Click here to Skip to main content
15,899,937 members
Home / Discussions / C#
   

C#

 
GeneralRe: execute query Pin
new to c# programming3-Jul-13 22:57
new to c# programming3-Jul-13 22:57 
GeneralRe: execute query Pin
new to c# programming4-Jul-13 0:21
new to c# programming4-Jul-13 0:21 
AnswerRe: execute query Pin
Amol_B4-Jul-13 0:31
professionalAmol_B4-Jul-13 0:31 
GeneralRe: execute query Pin
new to c# programming4-Jul-13 1:03
new to c# programming4-Jul-13 1:03 
GeneralRe: execute query Pin
Amol_B4-Jul-13 18:59
professionalAmol_B4-Jul-13 18:59 
AnswerRe: execute query Pin
Pete O'Hanlon3-Jul-13 20:58
mvePete O'Hanlon3-Jul-13 20:58 
GeneralRe: execute query Pin
Mycroft Holmes3-Jul-13 22:23
professionalMycroft Holmes3-Jul-13 22:23 
GeneralRe: execute query Pin
new to c# programming3-Jul-13 22:58
new to c# programming3-Jul-13 22:58 
GeneralRe: execute query Pin
new to c# programming4-Jul-13 0:20
new to c# programming4-Jul-13 0:20 
AnswerRe: execute query Pin
Richard MacCutchan3-Jul-13 21:02
mveRichard MacCutchan3-Jul-13 21:02 
QuestionAlign Text Vertically For PDF Document Pin
reethu_test3-Jul-13 15:25
reethu_test3-Jul-13 15:25 
AnswerRe: Align Text Vertically For PDF Document Pin
Garth J Lancaster3-Jul-13 16:12
professionalGarth J Lancaster3-Jul-13 16:12 
GeneralRe: Align Text Vertically For PDF Document Pin
reethu_test3-Jul-13 16:23
reethu_test3-Jul-13 16:23 
Questionc# and query result Pin
User34903-Jul-13 9:11
User34903-Jul-13 9:11 
AnswerRe: c# and query result Pin
Pete O'Hanlon3-Jul-13 10:09
mvePete O'Hanlon3-Jul-13 10:09 
GeneralRe: c# and query result Pin
User34903-Jul-13 10:15
User34903-Jul-13 10:15 
GeneralRe: c# and query result Pin
Pete O'Hanlon3-Jul-13 10:20
mvePete O'Hanlon3-Jul-13 10:20 
GeneralRe: c# and query result Pin
User34903-Jul-13 10:23
User34903-Jul-13 10:23 
GeneralRe: c# and query result Pin
Pete O'Hanlon3-Jul-13 10:29
mvePete O'Hanlon3-Jul-13 10:29 
GeneralRe: c# and query result Pin
KiranKumar Roy3-Jul-13 20:10
KiranKumar Roy3-Jul-13 20:10 
GeneralRe: c# and query result Pin
User34904-Jul-13 11:11
User34904-Jul-13 11:11 
Questionc# and query result Pin
User34903-Jul-13 7:21
User34903-Jul-13 7:21 
AnswerRe: c# and query result Pin
OriginalGriff3-Jul-13 8:35
mveOriginalGriff3-Jul-13 8:35 
It all depends on what your query is actually returning: it is very possible that your line:
C#
string rfyear = ((string)cmd_year.ExecuteScalar());
Will not work, but throw an InvalidCastException because the data coming back can't be cast to a string - it may work if you change it to:
C#
string rfyear = cmd_year.ExecuteScalar().ToString();
But...I wouldn't recommend it as there is a very good chance that you will get a string containing the name of the type of the value returned.

What does your query return when it works and when it fails?
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

QuestionCommon Trace Format in C# Pin
srikumarrampa3-Jul-13 4:08
srikumarrampa3-Jul-13 4:08 
AnswerRe: Common Trace Format in C# Pin
Pete O'Hanlon3-Jul-13 4:51
mvePete O'Hanlon3-Jul-13 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.