Click here to Skip to main content
15,887,683 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: IsPostBack Pin
PANKAJMAURYA27-Sep-15 22:00
professionalPANKAJMAURYA27-Sep-15 22:00 
AnswerRe: IsPostBack Pin
deepankarbhatnagar30-Sep-15 2:39
professionaldeepankarbhatnagar30-Sep-15 2:39 
AnswerRe: IsPostBack Pin
sridhar_thota7-Oct-15 21:16
sridhar_thota7-Oct-15 21:16 
QuestionHtmlTextWriter vs HtmlTable.RenderControl Pin
dashing_inn200323-Sep-15 17:57
professionaldashing_inn200323-Sep-15 17:57 
AnswerRe: HtmlTextWriter vs HtmlTable.RenderControl Pin
Richard MacCutchan23-Sep-15 21:45
mveRichard MacCutchan23-Sep-15 21:45 
QuestionHow to display results based on employees manager and department Pin
samflex22-Sep-15 17:23
samflex22-Sep-15 17:23 
AnswerRe: How to display results based on employees manager and department Pin
Herman<T>.Instance23-Sep-15 0:24
Herman<T>.Instance23-Sep-15 0:24 
SuggestionRe: How to display results based on employees manager and department Pin
Richard Deeming23-Sep-15 1:55
mveRichard Deeming23-Sep-15 1:55 
Your code is vulnerable to SQL Injection[^].

NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
VB.NET
Private Sub BindGrid()
    Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
    Using con As New SqlConnection(constr)
        Using cmd As New SqlCommand("SELECT e.empID, e.empname, e.department, a.managerID, a.status FROM Emp e INNER JOIN Angulers a ON a.empID = e.empID WHERE a.status = 'Done' and e.ManagerID = @ManagerID and e.department = @Department")
            cmd.Parameters.AddWithValue("@ManagerID", querystring("ID"))
            cmd.Parameters.AddWithValue("@Department", querystring("dept"))
            
            Using sda As New SqlDataAdapter(cmd)
                Using dt As New DataTable()
                    sda.Fill(dt)
                    GridView1.DataSource = dt
                    GridView1.DataBind()
                End Using
            End Using
        End Using
    End Using
End Sub


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[^]
SQL injection attack mechanics | Pluralsight [^]




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


GeneralRe: How to display results based on employees manager and department Pin
samflex23-Sep-15 2:37
samflex23-Sep-15 2:37 
AnswerRe: How to display results based on employees manager and department Pin
F-ES Sitecore23-Sep-15 5:56
professionalF-ES Sitecore23-Sep-15 5:56 
GeneralRe: How to display results based on employees manager and department Pin
samflex23-Sep-15 17:36
samflex23-Sep-15 17:36 
GeneralRe: How to display results based on employees manager and department Pin
F-ES Sitecore23-Sep-15 21:57
professionalF-ES Sitecore23-Sep-15 21:57 
GeneralRe: How to display results based on employees manager and department Pin
samflex24-Sep-15 3:42
samflex24-Sep-15 3:42 
GeneralRe: How to display results based on employees manager and department Pin
F-ES Sitecore24-Sep-15 3:48
professionalF-ES Sitecore24-Sep-15 3:48 
QuestionHow to open javasript pop on button click Pin
Member 1200294722-Sep-15 1:34
Member 1200294722-Sep-15 1:34 
AnswerRe: How to open javasript pop on button click Pin
JHizzle22-Sep-15 2:47
JHizzle22-Sep-15 2:47 
AnswerRe: How to open javasript pop on button click Pin
F-ES Sitecore22-Sep-15 7:17
professionalF-ES Sitecore22-Sep-15 7:17 
QuestionAspdotnet webservice using in HTML with Javascript Pin
J.Ramanjaneyulu21-Sep-15 4:17
J.Ramanjaneyulu21-Sep-15 4:17 
AnswerRe: Aspdotnet webservice using in HTML with Javascript Pin
Richard MacCutchan21-Sep-15 5:20
mveRichard MacCutchan21-Sep-15 5:20 
AnswerRe: Aspdotnet webservice using in HTML with Javascript Pin
Blikkies21-Sep-15 19:52
professionalBlikkies21-Sep-15 19:52 
GeneralRe: Aspdotnet webservice using in HTML with Javascript Pin
J.Ramanjaneyulu28-Sep-15 15:42
J.Ramanjaneyulu28-Sep-15 15:42 
QuestionRe: Aspdotnet webservice using in HTML with Javascript Pin
Blikkies28-Sep-15 19:37
professionalBlikkies28-Sep-15 19:37 
QuestionHelp .aspx/ going to another page Pin
Member 1199854620-Sep-15 14:44
Member 1199854620-Sep-15 14:44 
AnswerRe: Help .aspx/ going to another page Pin
Richard Andrew x6420-Sep-15 15:14
professionalRichard Andrew x6420-Sep-15 15:14 
GeneralRe: Help .aspx/ going to another page Pin
Member 1199854620-Sep-15 16:28
Member 1199854620-Sep-15 16:28 

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.