Click here to Skip to main content
15,889,116 members
Home / Discussions / C#
   

C#

 
GeneralColorPickerCombo Pin
Anandkumar.V28-Oct-08 20:03
Anandkumar.V28-Oct-08 20:03 
GeneralRe: ColorPickerCombo Pin
Ashfield28-Oct-08 22:45
Ashfield28-Oct-08 22:45 
QuestionPlug-in for Outlook using C# Pin
A.Asif28-Oct-08 18:44
A.Asif28-Oct-08 18:44 
Questionurgent -- file creation in c# Pin
Chithra Anoop28-Oct-08 15:26
Chithra Anoop28-Oct-08 15:26 
AnswerRe: urgent -- file creation in c# PinPopular
Mbah Dhaim28-Oct-08 16:33
Mbah Dhaim28-Oct-08 16:33 
GeneralRe: urgent -- file creation in c# Pin
Chithra Anoop28-Oct-08 16:47
Chithra Anoop28-Oct-08 16:47 
GeneralRe: urgent -- file creation in c# Pin
That Asian Guy28-Oct-08 18:47
That Asian Guy28-Oct-08 18:47 
QuestionAdd multiple values to a SqlParameter Pin
Brad Wick28-Oct-08 12:46
Brad Wick28-Oct-08 12:46 
I current have code to add the SQL Parameters to a array but when searching I need to sometimes not include the SQLParameter as its not required in the search. A example of my SQL Parameters is below which is passed to a function that runs the query.

SqlParameter[] sqlparams = {
          new SqlParameter("@EventID", EventID),
          new SqlParameter("@Status", Status)
        };


I tried to use the following code but it produces a error if one of the two values is not in the query string (I do not insert the EventID or Status in the query string if its not being search)

SqlParameter[] sqlparams = {
      EventID.Trim().Equals("") ? new SqlParameter() : new SqlParameter("@EventID", "%" + EventID.Trim() + "%"),
      Status.Trim().Equals("") ? new SqlParameter() : new SqlParameter("@Status", "%" + Status.Trim() + "%")
    };


What can I do to not include the @Status in the sqlparams if its empty?
AnswerRe: Add multiple values to a SqlParameter Pin
HemJoshi28-Oct-08 20:40
HemJoshi28-Oct-08 20:40 
AnswerRe: Add multiple values to a SqlParameter Pin
Giorgi Dalakishvili28-Oct-08 21:11
mentorGiorgi Dalakishvili28-Oct-08 21:11 
QuestionSmart Device Cab Installer Pin
blackdogjet28-Oct-08 12:28
blackdogjet28-Oct-08 12:28 
Questiontext color Pin
netJP12L28-Oct-08 10:58
netJP12L28-Oct-08 10:58 
QuestionListView logging takes focus from other controls Pin
Statoon420028-Oct-08 8:56
Statoon420028-Oct-08 8:56 
QuestionURGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
vinoo8028-Oct-08 8:41
vinoo8028-Oct-08 8:41 
AnswerRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
leckey28-Oct-08 9:50
leckey28-Oct-08 9:50 
GeneralRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
Paul Conrad28-Oct-08 11:05
professionalPaul Conrad28-Oct-08 11:05 
GeneralRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
leckey28-Oct-08 11:07
leckey28-Oct-08 11:07 
GeneralRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
Paul Conrad28-Oct-08 11:09
professionalPaul Conrad28-Oct-08 11:09 
GeneralRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
leckey28-Oct-08 11:10
leckey28-Oct-08 11:10 
GeneralRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
Paul Conrad28-Oct-08 11:14
professionalPaul Conrad28-Oct-08 11:14 
GeneralRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
vinoo8028-Oct-08 11:17
vinoo8028-Oct-08 11:17 
GeneralRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
Paul Conrad28-Oct-08 11:21
professionalPaul Conrad28-Oct-08 11:21 
GeneralRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
Furty29-Oct-08 0:48
Furty29-Oct-08 0:48 
AnswerRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
Kythen29-Oct-08 10:40
Kythen29-Oct-08 10:40 
GeneralRe: URGENT : Help with parsing the PDF generated by Crystal reports-V9 Pin
vinoo8029-Oct-08 15:40
vinoo8029-Oct-08 15:40 

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.