Click here to Skip to main content
15,920,801 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: when I press ENTER search button it automatically opening another page Pin
Afzaal Ahmad Zeeshan27-Sep-15 22:11
professionalAfzaal Ahmad Zeeshan27-Sep-15 22:11 
GeneralRe: when I press ENTER search button it automatically opening another page Pin
Member 1201610628-Sep-15 0:06
Member 1201610628-Sep-15 0:06 
AnswerRe: when I press ENTER search button it automatically opening another page. why is that so? Pin
F-ES Sitecore27-Sep-15 22:42
professionalF-ES Sitecore27-Sep-15 22:42 
GeneralRe: when I press ENTER search button it automatically opening another page. why is that so? Pin
Member 1201610628-Sep-15 0:07
Member 1201610628-Sep-15 0:07 
GeneralRe: when I press ENTER search button it automatically opening another page. why is that so? Pin
F-ES Sitecore28-Sep-15 0:15
professionalF-ES Sitecore28-Sep-15 0:15 
GeneralRe: when I press ENTER search button it automatically opening another page. why is that so? Pin
Member 1201610628-Sep-15 0:27
Member 1201610628-Sep-15 0:27 
QuestionIsPostBack Pin
Member 1116162527-Sep-15 19:26
Member 1116162527-Sep-15 19:26 
AnswerRe: IsPostBack Pin
Richard MacCutchan27-Sep-15 21:44
mveRichard MacCutchan27-Sep-15 21:44 
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 

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.