Click here to Skip to main content
16,004,828 members
Home / Discussions / C#
   

C#

 
GeneralRe: projects topics Pin
Christian Graus23-Aug-07 19:07
protectorChristian Graus23-Aug-07 19:07 
GeneralRe: projects topics Pin
Vasudevan Deepak Kumar23-Aug-07 21:13
Vasudevan Deepak Kumar23-Aug-07 21:13 
GeneralRe: projects topics Pin
Dave Kreskowiak24-Aug-07 1:45
mveDave Kreskowiak24-Aug-07 1:45 
GeneralRe: projects topics [modified] Pin
PIEBALDconsult24-Aug-07 8:26
mvePIEBALDconsult24-Aug-07 8:26 
Questionsql query Pin
falles0123-Aug-07 13:24
falles0123-Aug-07 13:24 
AnswerRe: sql query Pin
Christian Graus23-Aug-07 13:36
protectorChristian Graus23-Aug-07 13:36 
GeneralRe: sql query Pin
falles0123-Aug-07 13:47
falles0123-Aug-07 13:47 
GeneralRe: sql query Pin
Christian Graus23-Aug-07 13:59
protectorChristian Graus23-Aug-07 13:59 
falles01 wrote:
Also the only reason I had to change everything to public was because I am using inheritance. I ahve decided against that now.


The two do not follow. Protected gives you things that are private, but visible in derived classes.

falles01 wrote:
but I am concatenating C# with SQL so don't you use quotes so it knows what is C# code?


What I mean is, your final SQL will look like this:

where id ='323'

or something

The id should not be in quotes if it's a number, unless Access is different in that regard. I'm talking about the ' in your generated string, not the quotes around the static strings.

falles01 wrote:
It has seemed that for my insert statements it only works when I use.Tostring which to me is strange.


You may have to use ToString to get a string when yuo're building the SQL, which is a string. Howver, if you concatenate a string and an int, the int should go tostring by itself.,

falles01 wrote:
I am not on contracted work, I am a permanent worker who has been given the opportunity to learn C#.


I just read back on your older thread, so I get your situation now. Did you try getting the SQL out of the debugger and pasting it into Access ? Also, what does your data access code look like ?

Ideally, you'd have all your data access via stored procs, and seperated into a dll. For now, I'd recommend you create a class whose sole job is to manage any database calls, and put any data access in there. Make it static, and just call the methods to run the SQL, so in this instance, the method would take two params ( the name and the id ). you can then add methods to 'sanitise' your input against SQL injection attacks, but even if yuo don't, it makes sense to centralise your SQL, not least so you can reuse it if need be.


Christian Graus - Microsoft MVP - C++

"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

GeneralRe: sql query Pin
Dave Kreskowiak23-Aug-07 13:59
mveDave Kreskowiak23-Aug-07 13:59 
AnswerRe: sql query Pin
martin_hughes23-Aug-07 13:45
martin_hughes23-Aug-07 13:45 
AnswerRe: sql query Pin
Colin Angus Mackay23-Aug-07 14:00
Colin Angus Mackay23-Aug-07 14:00 
GeneralRe: sql query Pin
Christian Graus23-Aug-07 14:05
protectorChristian Graus23-Aug-07 14:05 
GeneralRe: sql query Pin
falles0123-Aug-07 14:32
falles0123-Aug-07 14:32 
GeneralRe: sql query Pin
Christian Graus23-Aug-07 16:47
protectorChristian Graus23-Aug-07 16:47 
GeneralRe: sql query Pin
falles0123-Aug-07 15:20
falles0123-Aug-07 15:20 
AnswerRe: sql query Pin
Vasudevan Deepak Kumar23-Aug-07 17:36
Vasudevan Deepak Kumar23-Aug-07 17:36 
GeneralRe: sql query Pin
Christian Graus23-Aug-07 18:16
protectorChristian Graus23-Aug-07 18:16 
Questionmicrsoft office + .NET Pin
shereem khaleel23-Aug-07 12:26
shereem khaleel23-Aug-07 12:26 
AnswerRe: micrsoft office + .NET Pin
Judah Gabriel Himango23-Aug-07 12:57
sponsorJudah Gabriel Himango23-Aug-07 12:57 
QuestionModifying text displayed in a webbrowser control Pin
Ahmad Zaidi23-Aug-07 10:59
Ahmad Zaidi23-Aug-07 10:59 
AnswerRe: Modifying text displayed in a webbrowser control Pin
ChrisKo23-Aug-07 11:58
ChrisKo23-Aug-07 11:58 
QuestionProblem with returning a string from a sub Pin
crash89323-Aug-07 9:36
crash89323-Aug-07 9:36 
AnswerRe: Problem with returning a string from a sub [modified] Pin
ChrisKo23-Aug-07 10:33
ChrisKo23-Aug-07 10:33 
GeneralRe: Problem with returning a string from a sub Pin
ChrisKo23-Aug-07 11:43
ChrisKo23-Aug-07 11:43 
GeneralRe: Problem with returning a string from a sub Pin
crash89323-Aug-07 12:12
crash89323-Aug-07 12:12 

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.