Click here to Skip to main content
15,896,201 members
Home / Discussions / C#
   

C#

 
Questioncannot implicitly convert type 'int' to 'string' Pin
twistz24-Jun-08 23:34
twistz24-Jun-08 23:34 
AnswerRe: cannot implicitly convert type 'int' to 'string' Pin
Christian Graus24-Jun-08 23:46
protectorChristian Graus24-Jun-08 23:46 
Well, did you read the error message ? Your function returns a string, and you're tring to return -10. Which is both stupid ( what does -10 mean ? ) and illegal ( an int is not a number ). The logical thing to return here is probably a bool. Why bother returning the string that was passed in ?

Where does strSelect come from ? This looks silly to me from the get go. You're just taking SQL as a string and calling it, this should not exist at all, but if it did, it should have a generic name, there is not guarentee it will delete anything.

There is so much wrong with this, you should probably go back to basics and do some reading. But, to fix the problem at hand, read your error messages and believe them. You said you were returning a string. The compiler won't turn an int to a string, so return a string, or change the return type. And, return something when the code doesn't blow up, too.

Christian Graus

Please read this if you don't understand the answer I've given you

"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

GeneralRe: cannot implicitly convert type 'int' to 'string' Pin
leppie25-Jun-08 2:14
leppie25-Jun-08 2:14 
GeneralRe: cannot implicitly convert type 'int' to 'string' Pin
Christian Graus25-Jun-08 12:05
protectorChristian Graus25-Jun-08 12:05 
AnswerRe: cannot implicitly convert type 'int' to 'string' Pin
Harvey Saayman24-Jun-08 23:47
Harvey Saayman24-Jun-08 23:47 
AnswerRe: cannot implicitly convert type 'int' to 'string' Pin
SteveNY25-Jun-08 3:59
SteveNY25-Jun-08 3:59 
Questionhowto: Image right-click context menu upload Pin
Sazarella24-Jun-08 23:24
Sazarella24-Jun-08 23:24 
AnswerRe: howto: Image right-click context menu upload Pin
Christian Graus24-Jun-08 23:34
protectorChristian Graus24-Jun-08 23:34 
GeneralRe: howto: Image right-click context menu upload Pin
Sazarella24-Jun-08 23:45
Sazarella24-Jun-08 23:45 
GeneralRe: howto: Image right-click context menu upload Pin
Christian Graus24-Jun-08 23:49
protectorChristian Graus24-Jun-08 23:49 
GeneralRe: howto: Image right-click context menu upload Pin
Sazarella24-Jun-08 23:58
Sazarella24-Jun-08 23:58 
GeneralRe: howto: Image right-click context menu upload Pin
Christian Graus25-Jun-08 0:06
protectorChristian Graus25-Jun-08 0:06 
GeneralRe: howto: Image right-click context menu upload Pin
Simon P Stevens25-Jun-08 0:20
Simon P Stevens25-Jun-08 0:20 
GeneralRe: howto: Image right-click context menu upload Pin
Sazarella25-Jun-08 3:33
Sazarella25-Jun-08 3:33 
GeneralRe: howto: Image right-click context menu upload Pin
Simon P Stevens25-Jun-08 10:18
Simon P Stevens25-Jun-08 10:18 
AnswerRe: howto: Image right-click context menu upload Pin
Ashfield25-Jun-08 0:39
Ashfield25-Jun-08 0:39 
GeneralRe: howto: Image right-click context menu upload Pin
Sazarella25-Jun-08 3:35
Sazarella25-Jun-08 3:35 
GeneralRe: howto: Image right-click context menu upload Pin
Ashfield25-Jun-08 3:45
Ashfield25-Jun-08 3:45 
GeneralRe: howto: Image right-click context menu upload Pin
Sazarella25-Jun-08 3:48
Sazarella25-Jun-08 3:48 
QuestionCan i run dll setup wizard Pin
wasimsharp24-Jun-08 22:53
wasimsharp24-Jun-08 22:53 
AnswerRe: Can i run dll setup wizard Pin
leppie24-Jun-08 23:28
leppie24-Jun-08 23:28 
GeneralRe: Can i run dll setup wizard Pin
wasimsharp24-Jun-08 23:34
wasimsharp24-Jun-08 23:34 
QuestionConsuming XFire Java web service from WCF Pin
Simon Lime24-Jun-08 22:42
Simon Lime24-Jun-08 22:42 
AnswerRe: Consuming XFire Java web service from WCF Pin
Simon Lime7-Jul-08 1:08
Simon Lime7-Jul-08 1:08 
QuestionHow to Allow only numbers for TextBox Pin
sacr8324-Jun-08 21:50
sacr8324-Jun-08 21:50 

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.