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

Database

 
AnswerRe: HOw can I link foxpro tables from MS SQL Server 2000 Pin
Steven J Jowett19-Dec-06 5:26
Steven J Jowett19-Dec-06 5:26 
GeneralRe: HOw can I link foxpro tables from MS SQL Server 2000 Pin
Guru_yogi19-Dec-06 18:48
Guru_yogi19-Dec-06 18:48 
QuestionIndexes on views Pin
karam chandrabose18-Dec-06 18:15
karam chandrabose18-Dec-06 18:15 
AnswerRe: Indexes on views Pin
Pete O'Hanlon19-Dec-06 0:30
mvePete O'Hanlon19-Dec-06 0:30 
QuestionUPDATE Query Error Pin
Expert Coming18-Dec-06 14:15
Expert Coming18-Dec-06 14:15 
AnswerRe: UPDATE Query Error Pin
Colin Angus Mackay18-Dec-06 22:39
Colin Angus Mackay18-Dec-06 22:39 
GeneralRe: UPDATE Query Error Pin
Paul Conrad19-Dec-06 5:55
professionalPaul Conrad19-Dec-06 5:55 
AnswerRe: UPDATE Query Error Pin
Pete O'Hanlon19-Dec-06 0:27
mvePete O'Hanlon19-Dec-06 0:27 
For a start, you don't have to escape apostrophes in your query. I agree with Colin that you are wide open and vulnerable to Injection attacks with this type of query (you'd be much better using a stored procedure). Plus, why have you formatted your query like this? Why not use AppendFormat. Why parse an item to an integer? SQL doesn't care what your initial datatype was (or even know it). Are you really using the ToolTip to store the value (is it not in the Tag)?

You could rewrite this as:

szMyQuery.AppendFormat("UPDATE [Player Data] SET [Father's Email] = '{0}'", txtDadEmail.Text);
szMyQuery.AppendFormat(" WHERE [Player Number] = {0}", lblOutput.Tag.ToString());


I wouldn't recommend this code (see Sql Injection Attacks[^] for a much better way to do this).


the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer

Deja View - the feeling that you've seen this post before.

GeneralRe: UPDATE Query Error Pin
Expert Coming19-Dec-06 11:16
Expert Coming19-Dec-06 11:16 
Question[Message Deleted] Pin
R_L_H18-Dec-06 10:30
R_L_H18-Dec-06 10:30 
AnswerRe: Getting SQL Server Express CREATE DATABASE directory Pin
Colin Angus Mackay18-Dec-06 13:00
Colin Angus Mackay18-Dec-06 13:00 
QuestionDeleting DataRows Pin
Karma3125118-Dec-06 8:04
Karma3125118-Dec-06 8:04 
AnswerRe: Deleting DataRows Pin
Colin Angus Mackay18-Dec-06 12:57
Colin Angus Mackay18-Dec-06 12:57 
GeneralRe: Deleting DataRows Pin
Paul Conrad18-Dec-06 13:14
professionalPaul Conrad18-Dec-06 13:14 
QuestionTricky question ob querys, how to solve ??? Pin
karam chandrabose18-Dec-06 6:30
karam chandrabose18-Dec-06 6:30 
AnswerRe: Tricky question ob querys, how to solve ??? Pin
Karma3125118-Dec-06 8:17
Karma3125118-Dec-06 8:17 
GeneralRe: Tricky question ob querys, how to solve ??? Pin
Colin Angus Mackay18-Dec-06 12:56
Colin Angus Mackay18-Dec-06 12:56 
AnswerRe: Tricky question ob querys, how to solve ??? Pin
Pete O'Hanlon18-Dec-06 8:45
mvePete O'Hanlon18-Dec-06 8:45 
GeneralRe: Tricky question ob querys, how to solve ??? Pin
karam chandrabose18-Dec-06 17:56
karam chandrabose18-Dec-06 17:56 
QuestionPlease Help me :( Pin
Dayekh18-Dec-06 5:45
Dayekh18-Dec-06 5:45 
AnswerRe: Please Help me :( Pin
Private_Void18-Dec-06 6:06
Private_Void18-Dec-06 6:06 
GeneralRe: Please Help me :( Pin
Dayekh18-Dec-06 22:45
Dayekh18-Dec-06 22:45 
GeneralRe: Please Help me :( Pin
Private_Void19-Dec-06 3:03
Private_Void19-Dec-06 3:03 
GeneralRe: Please Help me :( Pin
Dayekh19-Dec-06 4:56
Dayekh19-Dec-06 4:56 
QuestionReturn cols with values Pin
tadhg8818-Dec-06 1:24
tadhg8818-Dec-06 1:24 

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.