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

Database

 
QuestionSelect by date Pin
Sam Heller8-Jul-07 5:39
Sam Heller8-Jul-07 5:39 
AnswerRe: Select by date Pin
Mike Dimmick8-Jul-07 11:49
Mike Dimmick8-Jul-07 11:49 
GeneralRe: Select by date Pin
Sam Heller8-Jul-07 11:51
Sam Heller8-Jul-07 11:51 
AnswerRe: Select by date Pin
Thomas Chester9-Jul-07 7:53
Thomas Chester9-Jul-07 7:53 
QuestionUse ' one quotation make error with sql statmetn .. Pin
kindman_nb8-Jul-07 3:47
kindman_nb8-Jul-07 3:47 
AnswerRe: Use ' one quotation make error with sql statmetn .. Pin
Sam Heller8-Jul-07 5:51
Sam Heller8-Jul-07 5:51 
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
kindman_nb8-Jul-07 10:58
kindman_nb8-Jul-07 10:58 
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
Sam Heller8-Jul-07 11:05
Sam Heller8-Jul-07 11:05 
Ok originally I thought you were just writing the SQl as that but i see the problem you are encountering. There are a number of ways around this. The first would be to add code that reads the Text1.Text entry letter by letter and appends quotation marks around an quotation marks it finds. This will do the trick but you should be more aware that this method will not protect from you SQL injection attacks.

An attack of this kind would be for the user to simply write SQL code in your text box so that it too was run when you fire the statement at the SQL server. If the user had enough information they could potentially delete tables and hense your information. Not good.

The best way to get around this would be to use Stored Procedures. Stored procedures pass parameters as they come and cannot be mistaken by SQL as additional SQl code. I suggest you look this up as how you actually set them up would vary depending on your choice of platform but they do provide a much more secure solution. They really don't take that much more time to do and also make your code look alot simpler.
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
kindman_nb8-Jul-07 11:52
kindman_nb8-Jul-07 11:52 
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
Sam Heller8-Jul-07 11:53
Sam Heller8-Jul-07 11:53 
GeneralRe: Use ' one quotation make error with sql statmetn .. Pin
N a v a n e e t h8-Jul-07 23:03
N a v a n e e t h8-Jul-07 23:03 
Questiongetting error "“Invalid object name 'SizeMst'. “ " while exec sp Pin
mohd imran abdul aziz6-Jul-07 20:08
mohd imran abdul aziz6-Jul-07 20:08 
Questiona month all dates want to display..., Pin
Member 38798816-Jul-07 18:14
Member 38798816-Jul-07 18:14 
AnswerRe: a month all dates want to display..., Pin
Mike Dimmick7-Jul-07 2:32
Mike Dimmick7-Jul-07 2:32 
GeneralRe: a month all dates want to display..., Pin
Member 38798818-Jul-07 19:10
Member 38798818-Jul-07 19:10 
GeneralRe: a month all dates want to display..., Pin
Pete O'Hanlon8-Jul-07 23:05
mvePete O'Hanlon8-Jul-07 23:05 
Questionms access +c#.net (date comparison) Pin
hk779216-Jul-07 8:48
hk779216-Jul-07 8:48 
QuestionNetwork error while connecting to DB2/MVS from .Net Pin
viv_bhatt6-Jul-07 5:55
viv_bhatt6-Jul-07 5:55 
AnswerRe: Network error while connecting to DB2/MVS from .Net Pin
Mike Dimmick6-Jul-07 6:38
Mike Dimmick6-Jul-07 6:38 
GeneralRe: Network error while connecting to DB2/MVS from .Net Pin
viv_bhatt6-Jul-07 7:17
viv_bhatt6-Jul-07 7:17 
Questionsql query Pin
Laxmi R6-Jul-07 3:58
Laxmi R6-Jul-07 3:58 
AnswerRe: sql query Pin
Vishu Gurav6-Jul-07 11:11
Vishu Gurav6-Jul-07 11:11 
AnswerRe: sql query Pin
Mike Dimmick6-Jul-07 13:36
Mike Dimmick6-Jul-07 13:36 
GeneralRe: sql query Pin
Laxmi R8-Jul-07 19:54
Laxmi R8-Jul-07 19:54 
AnswerRe: sql query Pin
N a v a n e e t h9-Jul-07 0:36
N a v a n e e t h9-Jul-07 0:36 

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.