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

C#

 
QuestionNeed help with Sqldatareader Pin
erikhjerpe11-Aug-07 6:33
erikhjerpe11-Aug-07 6:33 
AnswerRe: Need help with Sqldatareader Pin
chinaQI11-Aug-07 7:10
chinaQI11-Aug-07 7:10 
GeneralRe: Need help with Sqldatareader Pin
erikhjerpe11-Aug-07 7:26
erikhjerpe11-Aug-07 7:26 
AnswerRe: Need help with Sqldatareader Pin
Colin Angus Mackay11-Aug-07 8:20
Colin Angus Mackay11-Aug-07 8:20 
GeneralRe: Need help with Sqldatareader Pin
erikhjerpe11-Aug-07 8:47
erikhjerpe11-Aug-07 8:47 
GeneralRe: Need help with Sqldatareader Pin
Colin Angus Mackay11-Aug-07 8:54
Colin Angus Mackay11-Aug-07 8:54 
GeneralRe: Need help with Sqldatareader Pin
erikhjerpe11-Aug-07 9:09
erikhjerpe11-Aug-07 9:09 
GeneralRe: Need help with Sqldatareader Pin
Justin.Jones11-Aug-07 18:01
Justin.Jones11-Aug-07 18:01 
We all have to start somewhere. Just a few tips of my own and I apologize if any are repeats.

Think stored procedures. That will solve the Sql injection attack problem by itself. At the very least use parameterized queries. This will solve more than just security issues. Imagine the headache of having to debug your app at 2am because somebody entered "Bob O'Malley" into a textbox?

put data connections, data readers, and commands into using statements. Especially the connections. Again, you don't want to be figuring out why your server came to a screeching halt at 2am because no connections ever closed.

DataSets are great, you can also use the reader to load that data into a collection of objects, close your connections, then pass the collection around anywhere you need it.

I know some of this may seem advanced if you're just getting started, but remember this is where you want to be going. It's never to early to start doing it right.


Oh, one more thing that I just noticed: you don't need a priming read on your datareader. This will actually cause you to throw away the first row of data. HTH.


J
Make the logo bigger

Questionupdating javascript value to database Pin
dsaikrishna11-Aug-07 2:03
dsaikrishna11-Aug-07 2:03 
AnswerRe: updating javascript value to database Pin
Guffa11-Aug-07 2:27
Guffa11-Aug-07 2:27 
GeneralRe: updating javascript value to database Pin
dsaikrishna11-Aug-07 2:36
dsaikrishna11-Aug-07 2:36 
GeneralRe: updating javascript value to database Pin
Justin.Jones11-Aug-07 18:14
Justin.Jones11-Aug-07 18:14 
AnswerRe: updating javascript value to database Pin
Michael Sync12-Aug-07 3:56
Michael Sync12-Aug-07 3:56 
Questionhi friends , do any one know how to create crystal reports Pin
prasadbuddhika11-Aug-07 0:06
prasadbuddhika11-Aug-07 0:06 
AnswerRe: hi friends , do any one know how to create crystal reports Pin
Rami Said Abd Alhalim11-Aug-07 1:43
Rami Said Abd Alhalim11-Aug-07 1:43 
QuestionRead a value from another form ! Pin
mrkeivan10-Aug-07 21:25
mrkeivan10-Aug-07 21:25 
AnswerRe: Read a value from another form ! Pin
Hessam Jalali10-Aug-07 21:49
Hessam Jalali10-Aug-07 21:49 
AnswerRe: Read a value from another form ! Pin
Giorgi Dalakishvili10-Aug-07 22:16
mentorGiorgi Dalakishvili10-Aug-07 22:16 
AnswerRe: Read a value from another form ! Pin
Michael Sync12-Aug-07 4:04
Michael Sync12-Aug-07 4:04 
Questionmdi parent form Pin
monuSaini10-Aug-07 20:09
monuSaini10-Aug-07 20:09 
AnswerRe: mdi parent form Pin
Hessam Jalali10-Aug-07 20:36
Hessam Jalali10-Aug-07 20:36 
GeneralRe: mdi parent form Pin
monuSaini10-Aug-07 20:58
monuSaini10-Aug-07 20:58 
GeneralRe: mdi parent form Pin
Hessam Jalali10-Aug-07 21:09
Hessam Jalali10-Aug-07 21:09 
Questioninternal /internal protected Pin
Sonia Gupta10-Aug-07 19:07
Sonia Gupta10-Aug-07 19:07 
GeneralRe: internal /internal protected Pin
Guffa11-Aug-07 2:10
Guffa11-Aug-07 2:10 

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.