Click here to Skip to main content
15,038,345 members
Home / Discussions / Database
   

Database

 
AnswerRe: Max. number of concurrent user in PostGre database Pin
Wendelius17-Aug-11 19:00
mveWendelius17-Aug-11 19:00 
GeneralRe: Max. number of concurrent user in PostGre database Pin
Navin Pandit17-Aug-11 19:10
MemberNavin Pandit17-Aug-11 19:10 
GeneralRe: Max. number of concurrent user in PostGre database Pin
Wendelius17-Aug-11 19:35
mveWendelius17-Aug-11 19:35 
GeneralRe: Max. number of concurrent user in PostGre database Pin
jschell18-Aug-11 13:02
Memberjschell18-Aug-11 13:02 
GeneralRe: Max. number of concurrent user in PostGre database Pin
Navin Pandit18-Aug-11 18:33
MemberNavin Pandit18-Aug-11 18:33 
GeneralRe: Max. number of concurrent user in PostGre database Pin
jschell19-Aug-11 7:34
Memberjschell19-Aug-11 7:34 
QuestionSearching with optional parameters [modified] Pin
Pascal Ganaye16-Aug-11 1:36
MemberPascal Ganaye16-Aug-11 1:36 
AnswerRe: Searching with optional parameters Pin
PIEBALDconsult16-Aug-11 3:23
professionalPIEBALDconsult16-Aug-11 3:23 
It looks as if using a stored procedure is the limiting factor.
I'd just cobble up the SQL in code and execute it. Slick as snot.

Something along the lines of (not tested, and I'm not awake yet either):

List<string:gt; parts = new List<string>() ;
List<IDbDataParameter> parms = new List<IDbDataParameter>() ;

cmd.CommandText = "SELECT TOP 100 * FROM Contacts " ;

if ( !System.String.IsNullOrEmpty ( Reference ) )
{
    parts.Add ( "Contacts.Reference = @Reference " ) ;

    IDbDataParameter prm = cmd.CreateParameter() ;
    prm.Name = "@Reference" ;
    prm.Value = Reference ;
    parms.Add ( prm ) ;
} 

...


if ( parts.Count > 0 )
{
    cmd.CommandText += "WHERE " ;

    cmd.CommandText += parts [ 0 ] ;
    cmd.Parameters.Add ( parms [ 0 ] ) ;

    for ( int i = 1 ; i < parts.Count ; i++ )
    {
        cmd.CommandText += "AND " ;

        cmd.CommandText += parts [ i ] ;
        cmd.Parameters.Add ( parms [ i ] ) ;
    }
}

cmd.ExecuteReader() ;

GeneralRe: Searching with optional parameters Pin
Pascal Ganaye16-Aug-11 4:16
MemberPascal Ganaye16-Aug-11 4:16 
AnswerRe: Searching with optional parameters Pin
Pascal Ganaye16-Aug-11 4:21
MemberPascal Ganaye16-Aug-11 4:21 
GeneralRe: Searching with optional parameters Pin
PIEBALDconsult16-Aug-11 17:56
professionalPIEBALDconsult16-Aug-11 17:56 
GeneralRe: Searching with optional parameters Pin
Mycroft Holmes16-Aug-11 18:06
professionalMycroft Holmes16-Aug-11 18:06 
GeneralRe: Searching with optional parameters Pin
PIEBALDconsult17-Aug-11 2:48
professionalPIEBALDconsult17-Aug-11 2:48 
GeneralRe: Searching with optional parameters Pin
Mycroft Holmes17-Aug-11 5:40
professionalMycroft Holmes17-Aug-11 5:40 
GeneralRe: Searching with optional parameters Pin
PIEBALDconsult17-Aug-11 14:11
professionalPIEBALDconsult17-Aug-11 14:11 
GeneralRe: Searching with optional parameters Pin
S Douglas20-Aug-11 7:53
professionalS Douglas20-Aug-11 7:53 
GeneralRe: Searching with optional parameters Pin
PIEBALDconsult20-Aug-11 13:01
professionalPIEBALDconsult20-Aug-11 13:01 
QuestionRe: Searching with optional parameters Pin
Shameel16-Aug-11 4:52
professionalShameel16-Aug-11 4:52 
AnswerRe: Searching with optional parameters Pin
Pascal Ganaye16-Aug-11 6:02
MemberPascal Ganaye16-Aug-11 6:02 
GeneralRe: Searching with optional parameters Pin
PIEBALDconsult16-Aug-11 18:04
professionalPIEBALDconsult16-Aug-11 18:04 
QuestionSQL bit to bool conversion [moved] Pin
5fingers16-Aug-11 0:37
Member5fingers16-Aug-11 0:37 
GeneralRe: SQL bit to bool conversion Pin
Nagy Vilmos16-Aug-11 0:39
professionalNagy Vilmos16-Aug-11 0:39 
GeneralRe: SQL bit to bool conversion Pin
Shameel16-Aug-11 4:53
professionalShameel16-Aug-11 4:53 
GeneralRe: SQL bit to bool conversion Pin
5fingers17-Aug-11 0:59
Member5fingers17-Aug-11 0:59 
GeneralRe: SQL bit to bool conversion Pin
Dalek Dave16-Aug-11 0:39
professionalDalek Dave16-Aug-11 0:39 

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.