Click here to Skip to main content
15,919,434 members
Home / Discussions / Database
   

Database

 
GeneralSQL Performance UserConnections Pin
Peter Kiss20-Mar-03 12:44
Peter Kiss20-Mar-03 12:44 
GeneralODBC and CListCtrl Pin
MemLeak20-Mar-03 10:17
MemLeak20-Mar-03 10:17 
GeneralAdding New records to Access DB Pin
Aaron Schaefer19-Mar-03 9:31
Aaron Schaefer19-Mar-03 9:31 
GeneralProblem using UPDATE Pin
Steve McLenithan19-Mar-03 2:51
Steve McLenithan19-Mar-03 2:51 
GeneralRe: Problem using UPDATE Pin
Philip Patrick19-Mar-03 10:03
professionalPhilip Patrick19-Mar-03 10:03 
GeneralRe: Problem using UPDATE Pin
Steve McLenithan20-Mar-03 10:40
Steve McLenithan20-Mar-03 10:40 
GeneralRe: Problem using UPDATE Pin
Philip Patrick20-Mar-03 10:56
professionalPhilip Patrick20-Mar-03 10:56 
GeneralRe: Problem using UPDATE Pin
Rein Hillmann21-Mar-03 10:08
Rein Hillmann21-Mar-03 10:08 
(This reply is not related to your problem - but related to performance and security)

Performance:
You're doing about 75 malloc and memcpy operations by the way you are building that string. Every time you append something to the string (by using the + operator) you are forcing the application to malloc memory (which does a memset too), copy memory, delete the old memory.
Try using the stringbuilder class instead. Using the stringbuilder class greatly reduces the number of times you do expensive malloc and memcpy operations.

Security:
Using statements such as
<br />
"[firstName] = '" + firstname.Text + "'",<br />

leaves you vulnerable to SQL injection attacks. Essentially, any firstname that contains an apostrophe will cause your SQL to be malformed. If you're unlucky, this malformed SQL can do damage to your data.
To avoid this, always qualify your text fields by doubling your apostrophes as follows:
<br />
"[firstName] = '" + firstname.Text.Replace("'", "''") + "'",<br />


This not meant as a personal attack at you or your methodology - it's just meant as a friendly reminder to please take into consideration performance and security. Smile | :)
GeneralRe: Problem using UPDATE Pin
Steve McLenithan21-Mar-03 12:27
Steve McLenithan21-Mar-03 12:27 
GeneralRe: Problem using UPDATE Pin
Rein Hillmann21-Mar-03 13:20
Rein Hillmann21-Mar-03 13:20 
GeneralRe: Problem using UPDATE Pin
Steve McLenithan21-Mar-03 13:53
Steve McLenithan21-Mar-03 13:53 
GeneralRe: Problem using UPDATE [ prob Narrowed down!!] Pin
Steve McLenithan21-Mar-03 20:16
Steve McLenithan21-Mar-03 20:16 
GeneralRe: Problem using UPDATE Pin
SimonS22-Mar-03 1:41
SimonS22-Mar-03 1:41 
GeneralRe: Problem using UPDATE Pin
Richard Deeming24-Mar-03 7:44
mveRichard Deeming24-Mar-03 7:44 
GeneralRe: Problem using UPDATE Pin
Steve McLenithan24-Mar-03 7:46
Steve McLenithan24-Mar-03 7:46 
GeneralAny Access experts here Pin
Michael P Butler18-Mar-03 23:13
Michael P Butler18-Mar-03 23:13 
GeneralRe: Any Access experts here Pin
Jeremy Oldham19-Mar-03 1:39
Jeremy Oldham19-Mar-03 1:39 
GeneralRe: Any Access experts here Pin
Michael P Butler19-Mar-03 3:25
Michael P Butler19-Mar-03 3:25 
GeneralDBConcurrencyException: Delete a entry in master -detail table Pin
DionChen18-Mar-03 10:16
DionChen18-Mar-03 10:16 
QuestionAlternatives to Access??? Pin
LukeV18-Mar-03 3:05
LukeV18-Mar-03 3:05 
AnswerRe: Alternatives to Access??? Pin
LukeV18-Mar-03 9:36
LukeV18-Mar-03 9:36 
GeneralRe: Alternatives to Access??? Pin
perlmunger18-Mar-03 11:01
perlmunger18-Mar-03 11:01 
AnswerRe: Alternatives to Access??? Pin
Alexander Kojevnikov18-Mar-03 22:13
Alexander Kojevnikov18-Mar-03 22:13 
QuestionCan ado.net support data warehouse metadata? Pin
mihi17-Mar-03 16:07
mihi17-Mar-03 16:07 
GeneralPerformance issues Pin
Le centriste17-Mar-03 9:37
Le centriste17-Mar-03 9:37 

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.