Click here to Skip to main content
15,886,857 members
Home / Discussions / C#
   

C#

 
JokeRe: Why Interface? Pin
Pete O'Hanlon18-Oct-16 9:20
mvePete O'Hanlon18-Oct-16 9:20 
GeneralRe: Why Interface? Pin
Gerry Schmitz18-Oct-16 20:36
mveGerry Schmitz18-Oct-16 20:36 
AnswerRe: Why Interface? Pin
Eddy Vluggen18-Oct-16 11:17
professionalEddy Vluggen18-Oct-16 11:17 
SuggestionRe: Why Interface? Pin
Richard Deeming18-Oct-16 12:21
mveRichard Deeming18-Oct-16 12:21 
GeneralRe: Why Interface? Pin
Eddy Vluggen18-Oct-16 12:36
professionalEddy Vluggen18-Oct-16 12:36 
QuestionCan't insert inkPicture into SQL Server database from C# Pin
Member 1178659318-Oct-16 0:17
Member 1178659318-Oct-16 0:17 
AnswerRe: Can't insert inkPicture into SQL Server database from C# Pin
OriginalGriff18-Oct-16 0:22
mveOriginalGriff18-Oct-16 0:22 
AnswerRe: Can't insert inkPicture into SQL Server database from C# Pin
Richard Deeming18-Oct-16 1:49
mveRichard Deeming18-Oct-16 1:49 
NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query. As well as fixing the bug in your current code, you will avoid SQL Injection vulnerabilities.

Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^]
How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^]
Query Parameterization Cheat Sheet | OWASP[^]

C#
using (var connection = new SqlConnection(con))
using (var command = new SqlCommand("INSERT INTO manage (Signature) VALUES (@Signature)", connection))
{
    byte[] saveInk = (byte[])axInkPicture1.Ink.Save(InkPersistenceFormat.IPF_GIF, InkPersistenceCompressionMode.IPCM_Default);
    command.Parameters.AddWithValue("@Signature", saveInk);
    
    connection.Open();
    command.ExecuteNonQuery();
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Can't insert inkPicture into SQL Server database from C# Pin
Member 1178659318-Oct-16 18:33
Member 1178659318-Oct-16 18:33 
GeneralRe: Can't insert inkPicture into SQL Server database from C# Pin
Member 1178659318-Oct-16 19:05
Member 1178659318-Oct-16 19:05 
GeneralRe: Can't insert inkPicture into SQL Server database from C# Pin
Richard Deeming19-Oct-16 2:07
mveRichard Deeming19-Oct-16 2:07 
QuestionRe: Can't insert inkPicture into SQL Server database from C# Pin
Eddy Vluggen19-Oct-16 3:35
professionalEddy Vluggen19-Oct-16 3:35 
QuestionConvert Char[ ] To Char ? [ ] Pin
MadDashCoder16-Oct-16 18:15
MadDashCoder16-Oct-16 18:15 
AnswerRe: Convert Char[ ] To Char ? [ ] Pin
Midi_Mick16-Oct-16 19:30
professionalMidi_Mick16-Oct-16 19:30 
AnswerRe: Convert Char[ ] To Char ? [ ] Pin
Nelson Costa Inácio18-Oct-16 4:44
Nelson Costa Inácio18-Oct-16 4:44 
QuestionUpdateProgress no disappear when i have a AsyncFileUpload control inside updatepanel Pin
whitesoul0115-Oct-16 4:26
whitesoul0115-Oct-16 4:26 
AnswerRe: UpdateProgress no disappear when i have a AsyncFileUpload control inside updatepanel Pin
Midi_Mick15-Oct-16 7:43
professionalMidi_Mick15-Oct-16 7:43 
SuggestionRe: UpdateProgress no disappear when i have a AsyncFileUpload control inside updatepanel Pin
Richard Deeming17-Oct-16 1:17
mveRichard Deeming17-Oct-16 1:17 
QuestionPrint if checkbox ticked? Pin
Member 1062775714-Oct-16 10:45
Member 1062775714-Oct-16 10:45 
AnswerRe: Print if checkbox ticked? Pin
NotPolitcallyCorrect14-Oct-16 11:39
NotPolitcallyCorrect14-Oct-16 11:39 
AnswerRe: Print if checkbox ticked? Pin
Midi_Mick14-Oct-16 14:09
professionalMidi_Mick14-Oct-16 14:09 
AnswerRe: Print if checkbox ticked? Pin
omeecode17-Oct-16 18:46
omeecode17-Oct-16 18:46 
QuestionPolymorphism Pin
Vanichandrik Suptajesacar13-Oct-16 17:00
Vanichandrik Suptajesacar13-Oct-16 17:00 
AnswerRe: Polymorphism Pin
OriginalGriff13-Oct-16 19:07
mveOriginalGriff13-Oct-16 19:07 
GeneralRe: Polymorphism Pin
Peter_in_278013-Oct-16 19:37
professionalPeter_in_278013-Oct-16 19: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.