Click here to Skip to main content
15,890,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: Do you think this is stupid ? Pin
Colin Angus Mackay7-May-05 3:37
Colin Angus Mackay7-May-05 3:37 
GeneralRe: Do you think this is stupid ? Pin
Sharpoverride7-May-05 3:42
Sharpoverride7-May-05 3:42 
AnswerRe: Do you think this is stupid ? Pin
Daniel Turini7-May-05 3:41
Daniel Turini7-May-05 3:41 
GeneralRe: Do you think this is stupid ? Pin
Sharpoverride7-May-05 3:44
Sharpoverride7-May-05 3:44 
GeneralCharacters in hexadecimal Pin
Shashidharreddy7-May-05 0:23
Shashidharreddy7-May-05 0:23 
GeneralRe: Characters in hexadecimal Pin
S. Senthil Kumar7-May-05 1:42
S. Senthil Kumar7-May-05 1:42 
GeneraloleDb Insert problem Pin
gmeii6-May-05 22:47
gmeii6-May-05 22:47 
GeneralRe: oleDb Insert problem Pin
Ken Haley7-May-05 3:37
Ken Haley7-May-05 3:37 
You can do it this way, but it's susceptible to SQL injection attacks (a common way that malicious users can attack a web site and destroy databases):

oleDbInsertCommand1.CommandText="INSERT INTO UserTable(Username,Password) VALUES('" + NewUserTextBox.Text + "','" + NewPasswordTextBox.Text + "')";

Instead you should set up an oleDbParameter collection and attach it to the oleDBInsertCommand1 object. You'd populate the paramters from the two textboxes (NewUserTextBox and NewPasswordTextBox). If you named these parameters '@NewUser' and '@NewPassword' respectively, then you'd code the CommandText as follows (notice that there are no single quotes here):

oleDbInsertCommand1.CommandText="INSERT INTO UserTable(Username,Password) VALUES(@NewUser, @NewPassword)";

This is the secure, recommended best-practice solution. There is more help on parameter collections in the Visual Studio on-line help.
GeneralRepaint form using Invalidate() Pin
gmeii6-May-05 22:32
gmeii6-May-05 22:32 
GeneralRe: Repaint form using Invalidate() Pin
Sharpoverride7-May-05 2:49
Sharpoverride7-May-05 2:49 
GeneralFlash Splash Screen Pin
gmeii6-May-05 22:08
gmeii6-May-05 22:08 
GeneralRe: Flash Splash Screen Pin
Sharpoverride7-May-05 2:45
Sharpoverride7-May-05 2:45 
GeneralOffice automation from C# Pin
Member 18788066-May-05 21:06
Member 18788066-May-05 21:06 
GeneralRe: Office automation from C# Pin
EEmad4-Jun-05 19:17
sussEEmad4-Jun-05 19:17 
Questionbones in meshes and directx? Pin
taha mohamed6-May-05 19:18
taha mohamed6-May-05 19:18 
GeneralCustomizing .NET Collection Editor Pin
heavenamour6-May-05 18:50
heavenamour6-May-05 18:50 
GeneralRe: Customizing .NET Collection Editor Pin
spif20016-May-05 21:04
spif20016-May-05 21:04 
GeneralRe: Customizing .NET Collection Editor Pin
heavenamour7-May-05 0:08
heavenamour7-May-05 0:08 
GeneralRe: Customizing .NET Collection Editor Pin
StealthyMark7-May-05 12:15
StealthyMark7-May-05 12:15 
GeneralCustomizing .NET Collection Editor Pin
heavenamour6-May-05 18:49
heavenamour6-May-05 18:49 
Generaldisplaying and zooming in and out of a pdf Pin
brian556-May-05 11:58
brian556-May-05 11:58 
GeneralRe: displaying and zooming in and out of a pdf Pin
Yulianto.6-May-05 16:23
Yulianto.6-May-05 16:23 
GeneralRe: displaying and zooming in and out of a pdf Pin
brian556-May-05 16:56
brian556-May-05 16:56 
GeneralRe: displaying and zooming in and out of a pdf Pin
Yulianto.6-May-05 17:07
Yulianto.6-May-05 17:07 
GeneralRe: displaying and zooming in and out of a pdf Pin
Uwe Keim7-May-05 5:23
sitebuilderUwe Keim7-May-05 5:23 

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.