Click here to Skip to main content
15,888,733 members
Home / Discussions / Database
   

Database

 
Generalsd Pin
Anonymous4-Jul-05 18:56
Anonymous4-Jul-05 18:56 
QuestionHow to optimise performance of retrieving multiple sql function results from DB Pin
luckyeagle4-Jul-05 12:50
luckyeagle4-Jul-05 12:50 
AnswerRe: How to optimise performance of retrieving multiple sql function results from DB Pin
Rob Graham4-Jul-05 13:14
Rob Graham4-Jul-05 13:14 
GeneralRe: How to optimise performance of retrieving multiple sql function results from DB Pin
luckyeagle4-Jul-05 14:43
luckyeagle4-Jul-05 14:43 
GeneralRe: How to optimise performance of retrieving multiple sql function results from DB Pin
Rob Graham5-Jul-05 5:56
Rob Graham5-Jul-05 5:56 
GeneralT-QL Problem Pin
WDI4-Jul-05 10:38
WDI4-Jul-05 10:38 
GeneralRe: T-QL Problem Pin
Colin Angus Mackay4-Jul-05 11:32
Colin Angus Mackay4-Jul-05 11:32 
GeneralRe: T-QL Problem Pin
WDI4-Jul-05 21:05
WDI4-Jul-05 21:05 
I do waht you told but get

Syntax error (missing operator) in query expression 'AND( styleID = @styleID )'.


my method is :

public static IDataReader GetFilteredProduct( FilterEN filterEN )
{
OleDbConnection oleDbConnection;

OleDbCommand oleDbCommand = new OleDbCommand();

OleDbDataReader oleDbDataReader = null;

oleDbCommand.CommandText = "select Product.productID , Product.productName ,
Product.productInfo , Product.productPrice ,
Product.dateOfInsert , Product.status ,
Product.artistID , Artist.artistName from Product
inner join Artist on Product.artistID =
Artist.artistID ";

oleDbConnection = new OleDbConnection (ConfigurationSettings.AppSettings["DbC"]);
try
{
oleDbConnection.Open();

string boolian = ( filterEN.Boolian == 1 ? "OR" : "AND" );

if ( filterEN.StyleID > 0 || filterEN.ArtistID > 0 )

{
oleDbCommand.CommandText += " where ";
}
if ( filterEN.StyleID > 0 )
{
oleDbCommand.CommandText += boolian + "( styleID = @styleID )";

OleDbParameter paramStyleID = new OleDbParameter ( "@styleID" ,
OleDbType.Integer );
paramStyleID.Value = filterEN.StyleID;

oleDbCommand.Parameters.Add ( paramStyleID );

}
if ( filterEN.ArtistID > 0 )
{
oleDbCommand.CommandText += boolian + "artistID = @artistID ";

OleDbParameter paramArtistID = new OleDbParameter ( "@artistID" ,
OleDbType.Integer );
paramArtistID.Value = filterEN.ArtistID;

oleDbCommand.Parameters.Add ( paramArtistID );

}


oleDbCommand.Connection = oleDbConnection;

oleDbDataReader = oleDbCommand.ExecuteReader(CommandBehavior.CloseConnection);
}
catch( Exception ex)
{
throw ex;
}

return oleDbDataReader;
}
GeneralRe: T-QL Problem Pin
Colin Angus Mackay4-Jul-05 22:46
Colin Angus Mackay4-Jul-05 22:46 
GeneralRe: T-QL Problem Pin
WDI5-Jul-05 3:29
WDI5-Jul-05 3:29 
GeneralRe: T-QL Problem Pin
Colin Angus Mackay5-Jul-05 3:38
Colin Angus Mackay5-Jul-05 3:38 
GeneralLDAP Frontend to MSSQL Pin
MrEyes4-Jul-05 2:13
MrEyes4-Jul-05 2:13 
GeneralIMPORT ACCESS FROM SQL SERVER 2000 Pin
RajithCAlwis4-Jul-05 0:47
RajithCAlwis4-Jul-05 0:47 
GeneralRe: IMPORT ACCESS FROM SQL SERVER 2000 Pin
Rob Graham4-Jul-05 13:23
Rob Graham4-Jul-05 13:23 
GeneralRe: IMPORT ACCESS FROM SQL SERVER 2000 Pin
RajithCAlwis4-Jul-05 17:02
RajithCAlwis4-Jul-05 17:02 
GeneralParadox lock Pin
Screwtape4-Jul-05 0:29
Screwtape4-Jul-05 0:29 
GeneralRe: Paradox lock Pin
Rob Graham4-Jul-05 13:25
Rob Graham4-Jul-05 13:25 
GeneralRe: Paradox lock Pin
Screwtape4-Jul-05 21:47
Screwtape4-Jul-05 21:47 
GeneralRe: Paradox lock Pin
Rob Graham5-Jul-05 6:01
Rob Graham5-Jul-05 6:01 
GeneralFilterData Set eproblem VB.NET Pin
monageasmear3-Jul-05 21:44
monageasmear3-Jul-05 21:44 
GeneralRe: FilterData Set eproblem VB.NET Pin
asithangae4-Jul-05 20:57
asithangae4-Jul-05 20:57 
GeneralUnicode Support Pin
Mr. Naveed Butt3-Jul-05 20:44
professionalMr. Naveed Butt3-Jul-05 20:44 
GeneralRe: Unicode Support Pin
Colin Angus Mackay3-Jul-05 21:17
Colin Angus Mackay3-Jul-05 21:17 
GeneralRe: Unicode Support Pin
Mr. Naveed Butt3-Jul-05 22:05
professionalMr. Naveed Butt3-Jul-05 22:05 
GeneralRe: Unicode Support Pin
Colin Angus Mackay3-Jul-05 22:38
Colin Angus Mackay3-Jul-05 22: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.