Click here to Skip to main content
15,909,498 members
Home / Discussions / C#
   

C#

 
Generalrich text bullets are not displayed in Crystal report. .net 2003 Pin
sundar_raj24-Sep-04 6:53
sundar_raj24-Sep-04 6:53 
GeneralC# Convolution Function Pin
ee9903524-Sep-04 6:27
ee9903524-Sep-04 6:27 
GeneralRe: C# Convolution Function Pin
yoaz26-Sep-04 3:59
yoaz26-Sep-04 3:59 
QuestionHow to read image files with extensions which are not predefined in C# Pin
Kiran Satish24-Sep-04 6:14
Kiran Satish24-Sep-04 6:14 
AnswerRe: How to read image files with extensions which are not predefined in C# Pin
Colin Angus Mackay24-Sep-04 6:54
Colin Angus Mackay24-Sep-04 6:54 
GeneralRe: How to read image files with extensions which are not predefined in C# Pin
Kiran Satish24-Sep-04 7:14
Kiran Satish24-Sep-04 7:14 
Generalfinding a record in a table Pin
steve_rm24-Sep-04 5:30
steve_rm24-Sep-04 5:30 
GeneralRe: finding a record in a table Pin
Heath Stewart24-Sep-04 6:44
protectorHeath Stewart24-Sep-04 6:44 
NEVER use concatenation for SQL commands. What do you think happens when I enter the following in your txtIDNumber TextBox?
0' and 1 = 1; drop table Teacher--
I'll tell you what happens - you get 0wned. Your Teacher table is dropped. I could do a lot worse, too. And don't think I can't figure out what you're doing. Many people will look for simple holes like this, and with .NET and Java (or any JIT compiled language or scripting language, for that matter) it's easy because I can easily disassemble or even decompile your application. With web applications some crackers will try typical SQL inject attacks like this. If a simple crack works, believe me they'll be dropping tables, stealing credit card numbers, falsifying product orders...just about anything.

Use parameterized queries like so:
cnnTeacher.ConnectionString = @"...";
OleDbCommand cmd = cnnTeacher.CreateCommand();
cmd.CommandText = "select * from Teacher where teacherID = ?";
cmd.Parameters.Add("ID", OleDb.VarWChar, 40).Value = txtIDNumber.Text;
OleDbDataAdapter daTeacher = new OleDbDataAdapter(cmd);
daTeacher.Fill(dtTeacher);
This prevents SQL injection attacks because there's a lot of checks implemented in the .NET Framework.

How do you bind data to controls? Certain not how you're doing it again. That is just assigning values, not actually binding data. To learn about data-binding, read Data Binding with Windows Forms and ADO.NET (.NET Development (General) Technical Articles)[^], any one of the samples in .NET Samples - Windows Forms: Data Binding[^], or search this site for a slew of articles on data-binding.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles]
GeneralRe: finding a record in a table Pin
Brian Delahunty24-Sep-04 12:34
Brian Delahunty24-Sep-04 12:34 
GeneralRe: finding a record in a table Pin
Heath Stewart24-Sep-04 15:01
protectorHeath Stewart24-Sep-04 15:01 
GeneralI remembered! Pin
eggie524-Sep-04 16:32
eggie524-Sep-04 16:32 
GeneralRe: I remembered! Pin
Heath Stewart25-Sep-04 9:19
protectorHeath Stewart25-Sep-04 9:19 
GeneralRe: I remembered! Pin
eggie525-Sep-04 11:08
eggie525-Sep-04 11:08 
GeneralRe: finding a record in a table Pin
Brian Delahunty25-Sep-04 0:04
Brian Delahunty25-Sep-04 0:04 
GeneralRe: finding a record in a table Pin
Heath Stewart25-Sep-04 9:24
protectorHeath Stewart25-Sep-04 9:24 
GeneralIE Hosted UserControl Pin
OBRon24-Sep-04 3:24
OBRon24-Sep-04 3:24 
GeneralRe: IE Hosted UserControl Pin
Heath Stewart24-Sep-04 6:02
protectorHeath Stewart24-Sep-04 6:02 
Generalinvisible items in combobox and listbox Pin
alvin@datell24-Sep-04 2:34
alvin@datell24-Sep-04 2:34 
GeneralRe: invisible items in combobox and listbox Pin
sreejith ss nair24-Sep-04 3:47
sreejith ss nair24-Sep-04 3:47 
GeneralRe: invisible items in combobox and listbox Pin
alvin@datell24-Sep-04 3:50
alvin@datell24-Sep-04 3:50 
GeneralRe: invisible items in combobox and listbox Pin
sreejith ss nair24-Sep-04 3:57
sreejith ss nair24-Sep-04 3:57 
GeneralRe: invisible items in combobox and listbox Pin
alvin@datell24-Sep-04 4:05
alvin@datell24-Sep-04 4:05 
GeneralRe: invisible items in combobox and listbox Pin
sreejith ss nair24-Sep-04 4:07
sreejith ss nair24-Sep-04 4:07 
GeneralRe: invisible items in combobox and listbox Pin
Filipe Peixinho11-Nov-04 10:19
Filipe Peixinho11-Nov-04 10:19 
GeneralWord_Counter Pin
sardonicus24-Sep-04 2:06
sardonicus24-Sep-04 2:06 

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.