Click here to Skip to main content
15,921,174 members
Home / Discussions / Database
   

Database

 
AnswerRe: Getting Maximum number: Pin
Rob Graham27-Sep-06 2:27
Rob Graham27-Sep-06 2:27 
AnswerRe: Getting Maximum number: Pin
Eric Dahlvang27-Sep-06 3:40
Eric Dahlvang27-Sep-06 3:40 
QuestionEncrypt in Dotnet and Decrypt in SQL 2000 Pin
Prash.26-Sep-06 21:54
Prash.26-Sep-06 21:54 
QuestionHow to write if i have 3 condition for WHERE? Pin
cheeken2u26-Sep-06 20:21
cheeken2u26-Sep-06 20:21 
AnswerRe: How to write if i have 3 condition for WHERE? Pin
albCode27-Sep-06 4:05
albCode27-Sep-06 4:05 
QuestionIDENT_CURRENT Pin
Polymorpher26-Sep-06 19:15
Polymorpher26-Sep-06 19:15 
QuestionHow to excute parameterized storeprocedure in LinkedServer Pin
Rickey_Me26-Sep-06 18:55
Rickey_Me26-Sep-06 18:55 
QuestionProblem with SELECT query using ADO.NET and C# Pin
Baz26-Sep-06 10:06
Baz26-Sep-06 10:06 
Hi guys,

Got this problem that's really annoying me as I can't find an answer and I know it's going to bug the hell out of me when a simple solution comes up.

Anyway, I'm using C# to connect to an Access database using the following code:

cmdFindLenders.CommandText = "SELECT ID FROM Company WHERE CompanyNameID='" + strCompany + "'";<br />
SqlDataReader rsFindLenders = cmdFindLenders.ExecuteReader();


However, due to Access and the crappy proprietory SQL is uses, it needs the string (the company name) to be passed through using double quotes, not single. So the SQL should read SELECT ID FROM Company WHERE CompanyName="Microsoft" rather than SELECT ID FROM Company WHERE CompanyName='Microsoft'

If I use the \" escape character in my SQL string, then the command text passed to Access isn't what I intended and it comes out like this: SELECT ID FROM Company WHERE CompanyName=\"Microsoft\"

Grrrrrr!!!! Mad | :mad: Any ideas any one?

Baz
AnswerRe: Problem with SELECT query using ADO.NET and C# Pin
indianet26-Sep-06 10:40
indianet26-Sep-06 10:40 
AnswerRe: Problem with SELECT query using ADO.NET and C# Pin
Rob Graham26-Sep-06 16:27
Rob Graham26-Sep-06 16:27 
GeneralRe: Problem with SELECT query using ADO.NET and C# Pin
Baz26-Sep-06 21:54
Baz26-Sep-06 21:54 
AnswerRe: Problem with SELECT query using ADO.NET and C# Pin
Edbert P26-Sep-06 18:10
Edbert P26-Sep-06 18:10 
GeneralRe: Problem with SELECT query using ADO.NET and C# Pin
Baz26-Sep-06 21:46
Baz26-Sep-06 21:46 
AnswerRe: Problem with SELECT query using ADO.NET and C# Pin
albCode27-Sep-06 1:05
albCode27-Sep-06 1:05 
QuestionSQL Datetime question Pin
cbrucewilson6426-Sep-06 8:44
cbrucewilson6426-Sep-06 8:44 
AnswerRe: SQL Datetime question Pin
Michael Potter26-Sep-06 9:09
Michael Potter26-Sep-06 9:09 
GeneralRe: SQL Datetime question Pin
cbrucewilson6427-Sep-06 2:36
cbrucewilson6427-Sep-06 2:36 
QuestionRe: SQL Datetime question Pin
Chris Meech26-Sep-06 9:44
Chris Meech26-Sep-06 9:44 
AnswerRe: SQL Datetime question Pin
cbrucewilson6427-Sep-06 2:42
cbrucewilson6427-Sep-06 2:42 
QuestionUpdate schema Pin
Soundman32.226-Sep-06 6:26
Soundman32.226-Sep-06 6:26 
AnswerRe: Update schema Pin
Mike Dimmick26-Sep-06 9:28
Mike Dimmick26-Sep-06 9:28 
Questionmultiple columns in rules Pin
Mridang Agarwalla26-Sep-06 3:58
Mridang Agarwalla26-Sep-06 3:58 
Questiondatareader and dataset Pin
Jax_qqq26-Sep-06 3:39
Jax_qqq26-Sep-06 3:39 
AnswerRe: datareader and dataset Pin
Colin Angus Mackay26-Sep-06 3:44
Colin Angus Mackay26-Sep-06 3:44 
QuestionHow to run the Job Pin
Atul Kharecha25-Sep-06 23:50
Atul Kharecha25-Sep-06 23:50 

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.