Click here to Skip to main content
15,914,014 members
Home / Discussions / C#
   

C#

 
QuestionHelp me about "BeginGetResponse" hang when HTTP server generate an "500" error. Pin
liubin_aluzi22-Sep-08 20:28
liubin_aluzi22-Sep-08 20:28 
AnswerRe: Help me about "BeginGetResponse" hang when HTTP server generate an "500" error. Pin
liubin_aluzi22-Sep-08 20:52
liubin_aluzi22-Sep-08 20:52 
QuestionCapture and Save Image Pin
sirisha guttikonda22-Sep-08 19:43
sirisha guttikonda22-Sep-08 19:43 
AnswerRe: Capture and Save Image Pin
N a v a n e e t h22-Sep-08 19:54
N a v a n e e t h22-Sep-08 19:54 
AnswerRe: Capture and Save Image Pin
Harvey Saayman22-Sep-08 20:53
Harvey Saayman22-Sep-08 20:53 
GeneralRe: Capture and Save Image Pin
Monark23-Sep-08 15:00
Monark23-Sep-08 15:00 
GeneralRe: Capture and Save Image Pin
Harvey Saayman23-Sep-08 23:21
Harvey Saayman23-Sep-08 23:21 
Questionvb vs c# variables in sql query strings [reform my question] Pin
Rafone22-Sep-08 19:34
Rafone22-Sep-08 19:34 
Greetings;

What is the best way with C#.net 2005 or 2008 to ...

I have a db that I only want to get info from (no updates) where the user's pick an ID number, start date and end date for the query. I would not know ahead of time what variables they choose.
So what is the best way to programatically form the query?


below is how we have always done it before.

In VB I have some query's that use variables they are setup this way.

I first added the single quotes i.e. I added sigle quotes i.e. ptID = "'"
& ptID & "'" then added " & ptID & " this gave me dbl,single quote variablename singl,dbl quote. All worked well in VB.

In C# I am trying the same thing SQL server requires the single quote so I am still getting the point with ptID = "'" + ptID + "'" then later " + ptID + ".

All works fine on the development box but on the test box I get errors that indicate that it is this formatting that is the problem.

So in C# what is the correct way to add in variables to the strSQL string. Am I doing it correctly now??

tia
Rafone

Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...

<div class="ForumMod">modified on Tuesday, September 23, 2008 12:42 PM</div>
AnswerRe: vb vs c# variables in sql query strings Pin
N a v a n e e t h22-Sep-08 19:57
N a v a n e e t h22-Sep-08 19:57 
AnswerRe: vb vs c# variables in sql query strings Pin
Nirandas22-Sep-08 20:43
Nirandas22-Sep-08 20:43 
GeneralRe: vb vs c# variables in sql query strings Pin
Rafone23-Sep-08 3:33
Rafone23-Sep-08 3:33 
GeneralRe: vb vs c# variables in sql query strings Pin
Nirandas23-Sep-08 4:10
Nirandas23-Sep-08 4:10 
GeneralRe: vb vs c# variables in sql query strings [modified] Pin
Rafone23-Sep-08 4:40
Rafone23-Sep-08 4:40 
GeneralRe: vb vs c# variables in sql query strings Pin
cpkilekofp24-Sep-08 7:16
cpkilekofp24-Sep-08 7:16 
GeneralRe: vb vs c# variables in sql query strings Pin
Rafone24-Sep-08 10:41
Rafone24-Sep-08 10:41 
QuestionRotation of cube Pin
aurosikhadas22-Sep-08 19:21
aurosikhadas22-Sep-08 19:21 
AnswerRe: Rotation of cube Pin
Roger Alsing22-Sep-08 20:17
Roger Alsing22-Sep-08 20:17 
AnswerRe: Rotation of cube Pin
Harvey Saayman22-Sep-08 20:48
Harvey Saayman22-Sep-08 20:48 
AnswerRe: Rotation of cube Pin
Mark Churchill23-Sep-08 23:09
Mark Churchill23-Sep-08 23:09 
QuestionToolStripStatusLabel gets painted with background color of underlying form Pin
Bliedtke22-Sep-08 18:21
Bliedtke22-Sep-08 18:21 
QuestionUnable to get updated config at app.config? Pin
mimimimilaw22-Sep-08 17:53
mimimimilaw22-Sep-08 17:53 
AnswerRe: Unable to get updated config at app.config? Pin
Harvey Saayman22-Sep-08 20:59
Harvey Saayman22-Sep-08 20:59 
QuestionHow to delete the nth line of a text file? Pin
Crul2322-Sep-08 13:54
Crul2322-Sep-08 13:54 
AnswerRe: How to delete the nth line of a text file? Pin
Bliedtke22-Sep-08 18:26
Bliedtke22-Sep-08 18:26 
AnswerRe: How to delete the nth line of a text file? Pin
PIEBALDconsult22-Sep-08 18:35
mvePIEBALDconsult22-Sep-08 18:35 

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.