Click here to Skip to main content
15,890,282 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Question(SOLVED) WHy is my image not displaying on a certain page? Pin
samflex3-Apr-19 6:28
samflex3-Apr-19 6:28 
AnswerRe: WHy is my image not displaying on a certain page? Pin
Richard Deeming3-Apr-19 7:48
mveRichard Deeming3-Apr-19 7:48 
GeneralRe: WHy is my image not displaying on a certain page? Pin
samflex3-Apr-19 9:56
samflex3-Apr-19 9:56 
GeneralRe: WHy is my image not displaying on a certain page? Pin
Richard Deeming3-Apr-19 22:00
mveRichard Deeming3-Apr-19 22:00 
GeneralRe: WHy is my image not displaying on a certain page? Pin
samflex4-Apr-19 5:59
samflex4-Apr-19 5:59 
QuestionLoad event fires twice and QueryString becomes empty!! Pin
pldelosrios2-Apr-19 3:41
pldelosrios2-Apr-19 3:41 
SuggestionRe: Load event fires twice and QueryString becomes empty!! Pin
Richard Deeming2-Apr-19 8:16
mveRichard Deeming2-Apr-19 8:16 
QuestionError 550 Permission denied: Windows Server 7 FTP Server ? Pin
Member 245846722-Mar-19 18:13
Member 245846722-Mar-19 18:13 
GeneralRe: Error 550 Permission denied: Windows Server 7 FTP Server ? Pin
Richard MacCutchan22-Mar-19 23:10
mveRichard MacCutchan22-Mar-19 23:10 
GeneralRe: Error 550 Permission denied: Windows Server 7 FTP Server ? Pin
Member 245846724-Mar-19 18:35
Member 245846724-Mar-19 18:35 
QuestionWant to find out differences between two branches (local or remote) in Git Pin
simpledeveloper22-Mar-19 20:47
simpledeveloper22-Mar-19 20:47 
AnswerRe: Want to find out differences between two branches (local or remote) in Git Pin
Richard MacCutchan23-Mar-19 2:29
mveRichard MacCutchan23-Mar-19 2:29 
Questionvisual studio for mac, Unexpected character '�' (CS1056) Pin
Member 1182460318-Mar-19 16:25
Member 1182460318-Mar-19 16:25 
AnswerRe: visual studio for mac, Unexpected character '�' (CS1056) Pin
Richard MacCutchan18-Mar-19 22:57
mveRichard MacCutchan18-Mar-19 22:57 
QuestionNot declared or inaccessible due to protection levels - VS 2017 errors Pin
Member 876166718-Mar-19 8:42
Member 876166718-Mar-19 8:42 
AnswerRe: Not declared or inaccessible due to protection levels - VS 2017 errors Pin
Richard Deeming18-Mar-19 9:27
mveRichard Deeming18-Mar-19 9:27 
GeneralRe: Not declared or inaccessible due to protection levels - VS 2017 errors Pin
Member 876166718-Mar-19 10:52
Member 876166718-Mar-19 10:52 
GeneralRe: Not declared or inaccessible due to protection levels - VS 2017 errors Pin
Richard Deeming19-Mar-19 2:01
mveRichard Deeming19-Mar-19 2:01 
GeneralRe: Not declared or inaccessible due to protection levels - VS 2017 errors Pin
Member 876166719-Mar-19 23:08
Member 876166719-Mar-19 23:08 
GeneralGrid view select operation to update data from form view Pin
Member 1418527517-Mar-19 1:01
Member 1418527517-Mar-19 1:01 
Questionnamespace error when using namespaces that don't match names ? Pin
Member 245846713-Mar-19 20:26
Member 245846713-Mar-19 20:26 
QuestionRe: namespace error when using namespaces that don't match names ? Pin
Richard MacCutchan13-Mar-19 22:24
mveRichard MacCutchan13-Mar-19 22:24 
AnswerRe: namespace error when using namespaces that don't match names ? Pin
Eddy Vluggen14-Mar-19 2:20
professionalEddy Vluggen14-Mar-19 2:20 
SuggestionRe: namespace error when using namespaces that don't match names ? Pin
Richard Deeming14-Mar-19 8:44
mveRichard Deeming14-Mar-19 8:44 
Member 2458467 wrote:
public static DataTable FillDatatable(string sSQL)

Your class is going to force you to write code which is vulnerable to SQL Injection[^]. You need to provide a way to pass parameters to the query without trying to stuff the parameter values into the query itself.
C#
public static DataTable FillDatatable(string commandText, params SqlParameter[] commandParameters)
{
    using (SqlConnection connection = CreateYourConnection())
    using (SqlCommand command = new SqlCommand(commandText, connection))
    {
        foreach (ICloneable p in commandParameters)
        {
            command.Parameters.Add((SqlParameter)p.Clone());
        }
        
        using (SqlDataAdapter da = new SqlDataAdapter(command))
        {
            DataTable table = new DataTable();
            da.Fill(table);
            return table;
        }
    }
}

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[^]



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

GeneralRe: namespace error when using namespaces that don't match names ? Pin
Member 24584673-May-19 20:35
Member 24584673-May-19 20:35 

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.