Click here to Skip to main content
15,890,438 members
Home / Discussions / Database
   

Database

 
AnswerRe: splitting data using sql Pin
Marcus J. Smith8-Mar-07 5:44
professionalMarcus J. Smith8-Mar-07 5:44 
QuestionRe: splitting data using sql Pin
Kunal P8-Mar-07 6:00
Kunal P8-Mar-07 6:00 
QuestionDynamic SQL Statements in Stored Procedure Pin
N a v a n e e t h8-Mar-07 3:01
N a v a n e e t h8-Mar-07 3:01 
AnswerRe: Dynamic SQL Statements in Stored Procedure Pin
Colin Angus Mackay8-Mar-07 3:27
Colin Angus Mackay8-Mar-07 3:27 
GeneralRe: Dynamic SQL Statements in Stored Procedure Pin
Frank Kerrigan8-Mar-07 11:55
Frank Kerrigan8-Mar-07 11:55 
GeneralRe: Dynamic SQL Statements in Stored Procedure Pin
Colin Angus Mackay8-Mar-07 11:57
Colin Angus Mackay8-Mar-07 11:57 
GeneralRe: Dynamic SQL Statements in Stored Procedure Pin
N a v a n e e t h8-Mar-07 20:09
N a v a n e e t h8-Mar-07 20:09 
GeneralRe: Dynamic SQL Statements in Stored Procedure Pin
Colin Angus Mackay8-Mar-07 21:26
Colin Angus Mackay8-Mar-07 21:26 
A parameterised query or stored procedure can be used

SELECT FirstName, LastName, Age, ...
FROM MyTable
WHERE (FirstName = @FirstName OR @FirstName IS NULL)
AND (LastName = @LastName OR @LastName IS NULL)
AND (Age = @Age OR @Age IS NULL)...


In your application:
if (string.IsNullOrEmpty(firstNameTextBox.Text))
    myCommand.Parameter.Add("@FirstName", DbNull.Value);
else
    myCommand.Parameter.Add("@FirstName, firstNameTextBox.Text);

// etc.


Upcoming events:
* Edinburgh: Web Security Conference Day for Windows Developers (12th April)
* Glasgow: AJAX, SQL Server, Mock Objects


My: Website | Blog | Photos

QuestionDateTime Problem Pin
sks838-Mar-07 2:50
sks838-Mar-07 2:50 
AnswerRe: DateTime Problem Pin
N a v a n e e t h8-Mar-07 3:04
N a v a n e e t h8-Mar-07 3:04 
AnswerRe: DateTime Problem Pin
Hayder Marzouk8-Mar-07 21:56
Hayder Marzouk8-Mar-07 21:56 
QuestionClient - Server Pin
alav8-Mar-07 1:56
alav8-Mar-07 1:56 
AnswerRe: Client - Server Pin
Pete O'Hanlon8-Mar-07 2:06
mvePete O'Hanlon8-Mar-07 2:06 
QuestionPIVOT in SQL 2005 problem Pin
Håkan Nilsson (k)8-Mar-07 0:20
Håkan Nilsson (k)8-Mar-07 0:20 
Questionoleobject in sql oracle mysql Pin
nikhil12347-Mar-07 22:35
nikhil12347-Mar-07 22:35 
AnswerRe: oleobject in sql oracle mysql Pin
Colin Angus Mackay8-Mar-07 0:08
Colin Angus Mackay8-Mar-07 0:08 
QuestionRegarding Video files Pin
praveen_gattu20007-Mar-07 21:22
praveen_gattu20007-Mar-07 21:22 
AnswerRe: Regarding Video files Pin
Paddy Boyd8-Mar-07 0:00
Paddy Boyd8-Mar-07 0:00 
AnswerRe: Insert Problem Pin
_anil_7-Mar-07 21:02
_anil_7-Mar-07 21:02 
GeneralRe: Insert Problem Pin
Colin Angus Mackay8-Mar-07 0:10
Colin Angus Mackay8-Mar-07 0:10 
Questionproblem on on date filtering Pin
firestoper7-Mar-07 19:45
firestoper7-Mar-07 19:45 
AnswerRe: problem on on date filtering Pin
andyharman7-Mar-07 22:40
professionalandyharman7-Mar-07 22:40 
GeneralRe: problem on on date filtering Pin
firestoper7-Mar-07 22:53
firestoper7-Mar-07 22:53 
GeneralRe: problem on on date filtering Pin
Pete O'Hanlon8-Mar-07 0:45
mvePete O'Hanlon8-Mar-07 0:45 
GeneralRe: problem on on date filtering Pin
andyharman8-Mar-07 1:38
professionalandyharman8-Mar-07 1:38 

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.