Click here to Skip to main content
15,891,529 members
Home / Discussions / Database
   

Database

 
GeneralRe: Problem with sql query in vb.net Pin
gundamhamtaro18-Apr-05 0:05
gundamhamtaro18-Apr-05 0:05 
GeneralRe: Problem with sql query in vb.net Pin
Colin Angus Mackay18-Apr-05 1:26
Colin Angus Mackay18-Apr-05 1:26 
GeneralRe: Problem with sql query in vb.net Pin
gundamhamtaro18-Apr-05 20:22
gundamhamtaro18-Apr-05 20:22 
GeneralRe: Problem with sql query in vb.net Pin
Colin Angus Mackay18-Apr-05 22:45
Colin Angus Mackay18-Apr-05 22:45 
GeneralFiltering on a variable in SQL Pin
Stuck!16-Apr-05 1:37
sussStuck!16-Apr-05 1:37 
GeneralRe: Filtering on a variable in SQL Pin
Colin Angus Mackay16-Apr-05 6:20
Colin Angus Mackay16-Apr-05 6:20 
GeneralRe: Filtering on a variable in SQL Pin
Stuck !16-Apr-05 22:09
sussStuck !16-Apr-05 22:09 
GeneralRe: Filtering on a variable in SQL Pin
Colin Angus Mackay16-Apr-05 23:44
Colin Angus Mackay16-Apr-05 23:44 
Okay. Like I said in my previous post you can replace your search criteria with a ? which is a parameter placeholder. So, your WHERE clause will look like this:
WHERE names = ?
You can then add the parameter value to your command object in VB.NET. For example:
MyCommand.Parameters.Add("search value", OleDbType.VarChar)
Remember that if you have more than one parameter then the order of the parameters in VB.NET must match the order of the ?s in the SQL Statement because Access does not support named parameters (in other DBs you can use a name prefixed with an @ instead of a ?)

Here are some links to some documentation you might find useful. They also contain examples of how to create a Command with parameters and run it:
OleDbCommand.Parameters[^]
OleDbParametersCollection.Add()[^]
OleDbType[^] enumerations


My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralRe: Filtering on a variable in SQL Pin
Anonymous17-Apr-05 4:43
Anonymous17-Apr-05 4:43 
GeneralRe: Filtering on a variable in SQL [another wee hint] Pin
Colin Angus Mackay16-Apr-05 6:23
Colin Angus Mackay16-Apr-05 6:23 
QuestionExecute SQL file in Enterprise Manager? Pin
c121hains15-Apr-05 13:10
c121hains15-Apr-05 13:10 
AnswerRe: Execute SQL file in Enterprise Manager? Pin
djkno315-Apr-05 13:29
djkno315-Apr-05 13:29 
GeneralSum on a portion of a column Pin
Esmo200015-Apr-05 9:50
Esmo200015-Apr-05 9:50 
GeneralRe: Sum on a portion of a column Pin
Colin Angus Mackay15-Apr-05 9:57
Colin Angus Mackay15-Apr-05 9:57 
GeneralDatabase SQL Syntax Comparison Pin
loane15-Apr-05 8:02
loane15-Apr-05 8:02 
GeneralRe: Database SQL Syntax Comparison Pin
loane15-Apr-05 8:18
loane15-Apr-05 8:18 
GeneralAS400 Connection using ADO.Net Pin
directred15-Apr-05 4:49
directred15-Apr-05 4:49 
GeneralRe: AS400 Connection using ADO.Net Pin
Colin Angus Mackay15-Apr-05 11:47
Colin Angus Mackay15-Apr-05 11:47 
GeneralExport ms sql server 2005 to .sql Pin
djkno315-Apr-05 3:55
djkno315-Apr-05 3:55 
GeneralRe: Export ms sql server 2005 to .sql Pin
Colin Angus Mackay15-Apr-05 11:49
Colin Angus Mackay15-Apr-05 11:49 
GeneralRe: Export ms sql server 2005 to .sql Pin
djkno315-Apr-05 13:27
djkno315-Apr-05 13:27 
GeneralRe: Export ms sql server 2005 to .sql Pin
Colin Angus Mackay15-Apr-05 23:16
Colin Angus Mackay15-Apr-05 23:16 
GeneralRe: Export ms sql server 2005 to .sql Pin
djkno316-Apr-05 3:51
djkno316-Apr-05 3:51 
GeneralRe: Export ms sql server 2005 to .sql Pin
Mike Dimmick18-Apr-05 1:09
Mike Dimmick18-Apr-05 1:09 
GeneralRe: Export ms sql server 2005 to .sql Pin
djkno318-Apr-05 1:25
djkno318-Apr-05 1:25 

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.