SQL Query Design functionality
I want to get opinions before I start design or functionality my query filters:
Lets Say :
I have one report with several fields:
I want to do all of these querie via the report, keep in mind each field is coming from a drop down box, so the filters are going to be base off of the selected item from any particular dropbox, also keep in mind the drop box only has values that exists no matter what
drowDownbox 1 = A values drowDownbox 2 = A values
drowDownbox 3 = C values drowDownbox 4 = E values
Select A, B, C, D, E, F
From Table1
Where (A = ?) And (B = ?)
Select A, B, C, D, E, F
From Table1
Where (A = ?) And (B = ?)
Select A, B, C, D, E, F
From Table1
Where (A = ?) And (B = ?)
Select A, B, C, D, E, F
From Table1
Where (A = ?) And (B = ?) AND (E = ?)
Select A, B, C, D, E, F
From Table1
Where (A = ?) And (C = 'FAIL') AND (E = 'PASS')
etc..........................
Answers (4)
0
thanks for mentioning connection string. i did close the connection in the connection method. infact i mustn't do that.. thanks alot...
0
int intParamCount = 0;
SqlParameter[] sqlParam=new SqlParameter[2];
SqlCommand objInsertCommand=new SqlCommand("sp_InsertReserve",objConn); //specify the connection
objInsertCommand.CommandType =CommandType.StoredProcedure;
//Associate Parameters
sqlParam[0]=new SqlParameter("@reservationUserID",SqlDbType.VarChar );
sqlParam[0].Direction =ParameterDirection.Input ;
sqlParam[0].Value =UID;
sqlParam[1]=new SqlParameter("@reservationBookID",SqlDbType.VarChar );
sqlParam[1].Direction =ParameterDirection.Input ;
sqlParam[1].Value =BID;
while(intParamCount
0
In your code where are you setting the connection object?