error in debugging (Incorrect syntax near the keyword 'LIKE')

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I designed two forms first is loging second is main form so I wrote a code for loging form and loging button, when I debug and fill userid and password and click login button I get error says:
Incorrect syntax near the keyword LIKE.
why?
here is the code:
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff
Imports
</font></font></font><font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff

</font></font><font face="Consolas" size="2" color="#0000ff

</font>
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small System.Data
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff
Imports
</font></font></font><font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff

</font></font><font face="Consolas" size="2" color="#0000ff

</font>
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small System.Data.SqlClient
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff
Public
</font></font></font><font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff

</font></font><font face="Consolas" size="2" color="#0000ff

</font>
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Class<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small Login
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Private<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
m_cn <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small New<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small SqlConnection<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small ()
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff
Private
</font></font></font><font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff

</font></font><font face="Consolas" size="2" color="#0000ff

</font>
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Sub<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
Login_Load(<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small ByVal<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
sender <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
System.<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small Object<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small ,
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small ByVal<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
e <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
System.<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small EventArgs<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small )
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Handles<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small MyBase<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small .Load<font face="Consolas" size="2 <font face="Consolas" size="2

m_cn.ConnectionString =
</font></font><font face="Consolas" size="2

</font>

<span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small "Data Source=.SQLEXPRESS; AttachDbFilename = "<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
& _<font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>

<span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small "C:UsersAbdullahDesktopTask Tracking.vbTaskTrackingDB.mdf;Integrated
Security=True; Connect Timeout=30;"<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small & _<font face="Consolas" size="2 <font face="Consolas" size="2


</font></font><font face="Consolas" size="2

</font>

<span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small "User Instance=True"
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
m_cn.Open()
 
<font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small End<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Sub
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Private<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Sub<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
Button1_Click(<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small ByVal<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
sender <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
System.<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small Object<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small ,
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small ByVal<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
e <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
System.<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small EventArgs<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small )
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Handles<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
Button1.Click<font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>

<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Dim<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
cmdString1 <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small String<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
= <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small "SELECT UserID, Password, FirstName,
LastName, IsAdmin FROM UserAccountTable"
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Dim<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
cmdString2 <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small String<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
= <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small "WHERE(UserID LIKE @Param1) AND (Password
LIKE @Param2)"
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Dim<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
cmdString <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small String<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
= cmdString1 & cmdString2<font face="Consolas" size="2 <font face="Consolas" size="2


</font></font><font face="Consolas" size="2

</font>

<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Dim<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
paramUserID <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small New<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small SqlParameter
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Dim<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
paramPassword <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small New<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small SqlParameter
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Dim<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
UserAccountTableAdapter <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small New<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small SqlDataAdapter
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Dim<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
sqlDataTable <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small New<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small DataTable
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Dim<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
sqlcommand <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small New<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small SqlCommand
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Dim<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
ttracking <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small As<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small New<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small Task_Tracking
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
 
<font face="Consolas" size="2 <font face="Consolas" size="2
paramUserID.ParameterName =
</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small "@Param1"
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
paramUserID.Value = txtUserID.Text
<font face="Consolas" size="2 <font face="Consolas" size="2
paramPassword.ParameterName =
</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small "@param2"
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
paramPassword.Value = txtPassword.Text
sqlcommand.Connection = m_cn
<font face="Consolas" size="2 <font face="Consolas" size="2
sqlcommand.CommandType =
</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small CommandType<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small .Text

sqlcommand.CommandText = cmdString
sqlcommand.Parameters.Add(paramUserID)
sqlcommand.Parameters.Add(paramPassword)
UserAccountTableAdapter.SelectCommand = sqlcommand
UserAccountTableAdapter.Fill(sqlDataTable)
<font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>

<span style="font-family:Consolas; color:#008000; font-size:x-small <span style="font-family:Consolas; color:#008000; font-size:x-small <span style="font-family:Consolas; color:#008000; font-size:x-small UserAccountTableAdapter.Fill(sqlDataTable)
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small If<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
sqlDataTable.Rows.Count > 0 <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Then
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
ttracking.Show()
<font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Me<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small .Hide()<font face="Consolas" size="2 <font face="Consolas" size="2


</font></font><font face="Consolas" size="2

</font>

<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Else
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small <span style="font-family:Consolas; color:#2b91af; font-size:x-small MessageBox<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small .Show(<span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small <span style="font-family:Consolas; color:#a31515; font-size:x-small "Incorrect
userid or password"<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small )<font face="Consolas" size="2 <font face="Consolas" size="2


</font></font><font face="Consolas" size="2

</font>

<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small End<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small If
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
sqlDataTable.Dispose()
<font face="Consolas" size="2 <font face="Consolas" size="2
sqlDataTable =
</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Nothing
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
sqlcommand.Dispose()
<font face="Consolas" size="2 <font face="Consolas" size="2
sqlcommand =
</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Nothing
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
UserAccountTableAdapter.Dispose()
<font face="Consolas" size="2 <font face="Consolas" size="2
UserAccountTableAdapter =
</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Nothing
<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <font face="Consolas" size="2 <font face="Consolas" size="2

</font></font><font face="Consolas" size="2

</font>
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small End<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small
<span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Sub<font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff

End
</font></font></font><font face="Consolas" size="2" color="#0000ff <font face="Consolas" size="2" color="#0000ff

</font></font><font face="Consolas" size="2" color="#0000ff

</font>

<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small <span style="font-family:Consolas; color:#0000ff; font-size:x-small Class

<span style="font-family:Consolas; font-size:x-small <span style="font-family:Consolas; font-size:x-small

View the full article
 
Back
Top