c# - An expression of non-boolean type specified in a context where a condition is expected, near 'ID' -


Can someone indicate what is the cause of this error? I was trying to fix it, but I failed. I do not know what's wrong with 'id' ... which part generates this error?

Here's my code:

  Secure Zero Button 1_kill (Object Sender, EventAggles e) {SqlConnection conn = New SqlConnection (); Conn.ConnectionString = SqlDataSource1.ConnectionString; String str = "select from student" + "where student id = '" + student id Text + "'and" + "password ='" + password " Text "" "; SqlCommand cmdSelect = New SqlCommand (str, conn); SqlDataReader Reader; Conn.Open (); Select Reader = CMD. Spare reader (); If (reader.Read ()) {if (StudentID.Text == "900000000") response. Type ("& lt; body onload = \" window.open ('Admin.aspx', '_top') "" & gt; & lt; / body & gt; "); Other feedback Type ("& lt; body onload = \" window.open ('user.aspx', '_top') \ "& gt; & lt; / body & gt;"); } Else lblMsg.Text = "Invalid user name and / or password, please try again !!"; Conn.Close (); }    

select WHERE Student.ID ... (You have a place instead of a dot)

You can use student completely and only id (as you have password ).

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -