PDA

View Full Version : خطای .'?'Incorrect syntax near



behzad_rainy
یک شنبه 13 شهریور 1390, 21:17 عصر
]سلام
من کدی رو واسه تشخیص هویت نوشتم اما وقتی یوزر و پسورد رو وارد می کنم خطای Incorrect syntax near '?'. رو میده
اینم کد
خواهش می کنم راهنماییم کنید




strcon = "Data Source=(local)\\SQLExpress;AttachDbFilename=|DataD irectory|site.mdf;Integrated Security=True;User Instance=True";
con = new SqlConnection(strcon);
SqlCommand cmd = new SqlCommand("select count(*) from muser where uid=? and pwd=?", con);
cmd.Parameters.AddWithValue("uid", txtUserID.Text);
cmd.Parameters.AddWithValue("pwd", txtPWD.Text);
con.Open();
object retVal = cmd.ExecuteScalar();
if(Convert.ToInt32(retVal)==1)
{
FormsAuthentication.RedirectFromLoginPage(txtUserI D.Text, chk_member.Checked);
con.Close();
}
else if (Convert.ToInt32(retVal)!=null)
{
lbl.Visible = true;
con.Close();
}

ahrimaneahurai
یک شنبه 13 شهریور 1390, 21:56 عصر
به جای ؟ از uid@ استفاده کنید.

behzad_rainy
یک شنبه 13 شهریور 1390, 22:20 عصر
به جای ؟ از uid@ استفاده کنید.
دستت درد نکنه مهندس درست شد
یاشاااا