Click here to Skip to main content
15,888,052 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
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 
Below is the best I could come up with. Now the SQL injection error was showing up in the actual ExecuteScaler function using the SQL string being passed in as so:

The old version my code replaced: protected object ExecuteScaler(string queryString)

Now my version of the function is as so: protected Object ExecuteScaler(QueryContainer Instance)

The calling function is now converted as so:

public int GetAccountSortByAccountCode(int account)
        {
            QueryContainer Instance = new QueryContainer("SELECT ac_sort_order FROM lkup_account_codes where ac_code = " + account.ToString());

            return Convert.ToInt32(ExecuteScaler(Instance.Query));
        }  <pre>

And here is my new class:

<pre>
public class QueryContainer
    {
        string _query;

        public QueryContainer(string query) { _query = query; }

        public string Query
        {
            get
            {
                return _query;
            }

            set { _query = value;  }
        }
    }
<pre>

So what do you think. Does someone that I will still get SQL injection errors?

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 
GeneralRe: Help with a static class [modified] Pin
Sascha Lefèvre18-May-15 2:07
professionalSascha Lefèvre18-May-15 2:07 
GeneralRe: Help with a static class Pin
Sascha Lefèvre18-May-15 2:10
professionalSascha Lefèvre18-May-15 2:10 
GeneralRe: Help with a static class Pin
Richard Deeming18-May-15 2:36
mveRichard Deeming18-May-15 2:36 
GeneralRe: Help with a static class Pin
Stephen Holdorf18-May-15 3:48
Stephen Holdorf18-May-15 3:48 
GeneralRe: Help with a static class Pin
Richard Deeming18-May-15 3:50
mveRichard Deeming18-May-15 3:50 
GeneralRe: Help with a static class Pin
jkirkerx18-May-15 12:19
professionaljkirkerx18-May-15 12:19 
GeneralRe: Help with a static class Pin
Stephen Holdorf20-May-15 3:02
Stephen Holdorf20-May-15 3:02 
GeneralRe: Help with a static class Pin
Sascha Lefèvre20-May-15 4:22
professionalSascha Lefèvre20-May-15 4:22 
GeneralRe: Help with a static class Pin
Stephen Holdorf20-May-15 4:28
Stephen Holdorf20-May-15 4:28 
GeneralRe: Help with a static class Pin
Sascha Lefèvre20-May-15 4:34
professionalSascha Lefèvre20-May-15 4:34 
GeneralRe: Help with a static class Pin
Stephen Holdorf20-May-15 4:40
Stephen Holdorf20-May-15 4:40 
GeneralRe: Help with a static class Pin
Sascha Lefèvre20-May-15 4:43
professionalSascha Lefèvre20-May-15 4:43 
GeneralRe: Help with a static class Pin
Stephen Holdorf20-May-15 4:45
Stephen Holdorf20-May-15 4:45 
GeneralRe: Help with a static class Pin
Sascha Lefèvre20-May-15 4:54
professionalSascha Lefèvre20-May-15 4:54 

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.