Click here to Skip to main content
15,908,931 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Memory issues with 32-bit app Pin
Bala.ram1-Jun-15 20:26
Bala.ram1-Jun-15 20:26 
GeneralRe: Memory issues with 32-bit app Pin
jkirkerx2-Jun-15 6:17
professionaljkirkerx2-Jun-15 6:17 
QuestionMessage Closed Pin
21-May-15 5:16
Stephen Holdorf21-May-15 5:16 
AnswerRe: MS SqlDbType to C# type converter Pin
Richard MacCutchan21-May-15 5:39
mveRichard MacCutchan21-May-15 5:39 
AnswerRe: MS SqlDbType to C# type converter Pin
jkirkerx21-May-15 13:29
professionaljkirkerx21-May-15 13:29 
GeneralRe: MS SqlDbType to C# type converter Pin
Stephen Holdorf27-May-15 8:56
Stephen Holdorf27-May-15 8:56 
GeneralRe: MS SqlDbType to C# type converter Pin
jkirkerx27-May-15 9:20
professionaljkirkerx27-May-15 9:20 
Questionhow to develop price comparison website in asp.net? Pin
only4ram20-May-15 0:03
only4ram20-May-15 0:03 
GeneralRe: how to develop price comparison website in asp.net? Pin
Richard MacCutchan20-May-15 0:11
mveRichard MacCutchan20-May-15 0:11 
QuestionSelf Hosted SignalR Issues Pin
bennettdan18-May-15 17:17
bennettdan18-May-15 17:17 
QuestionBase64 Image is corrupted or truncated Pin
JeganMaria18-May-15 2:25
JeganMaria18-May-15 2:25 
AnswerREPOST Pin
Afzaal Ahmad Zeeshan18-May-15 3:46
professionalAfzaal Ahmad Zeeshan18-May-15 3:46 
QuestionHow to get source files from GoDaddy to local machine Pin
indian14316-May-15 8:41
indian14316-May-15 8:41 
AnswerRe: How to get source files from GoDaddy to local machine Pin
F-ES Sitecore16-May-15 10:05
professionalF-ES Sitecore16-May-15 10:05 
GeneralRe: How to get source files from GoDaddy to local machine Pin
indian14316-May-15 18:56
indian14316-May-15 18:56 
QuestionMessage Closed Pin
15-May-15 4:15
Mohammad Sadegh Zohari15-May-15 4:15 
QuestionHelp with a static class Pin
Stephen Holdorf15-May-15 2:10
Stephen Holdorf15-May-15 2:10 
QuestionRe: Help with a static class Pin
Richard MacCutchan15-May-15 3:02
mveRichard MacCutchan15-May-15 3:02 
SuggestionRe: Help with a static class Pin
Richard Deeming15-May-15 3:56
mveRichard Deeming15-May-15 3:56 
As Sascha told you two days ago[^], that class does not resolve your SQL Injection[^] vulnerabilities.

Rather than wasting time trying to fix this class, concentrate on fixing the calling code. You can either do that by writing raw ADO.NET code using properly parameterized queries; or you can use something like Dapper[^]; or switch to one of the many available .NET ORM solutions.

Correct ADO.NET code would look something like this:
C#
public int GetAccountSortByAccountCode(int account)
{
    using (var connection = new SqlConnection("YOUR CONNECTION STRING"))
    using (var command = new SqlCommand("SELECT ac_sort_order FROM lkup_account_codes where ac_code = @account", connection))
    {
        command.Parameters.AddWithValue("@account", account);

        connection.Open();
        return Convert.ToInt32(command.ExecuteScalar());
    }
}




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


GeneralRe: Help with a static class Pin
Stephen Holdorf15-May-15 4:09
Stephen Holdorf15-May-15 4:09 
GeneralRe: Help with a static class Pin
Richard Deeming15-May-15 4:11
mveRichard Deeming15-May-15 4:11 
GeneralRe: Help with a static class Pin
Stephen Holdorf15-May-15 6:52
Stephen Holdorf15-May-15 6:52 
GeneralRe: Help with a static class Pin
Richard Deeming15-May-15 7:04
mveRichard Deeming15-May-15 7:04 
GeneralRe: Help with a static class Pin
Sascha Lefèvre15-May-15 8:23
professionalSascha Lefèvre15-May-15 8:23 
GeneralRe: Help with a static class Pin
Stephen Holdorf18-May-15 1:47
Stephen Holdorf18-May-15 1:47 

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.