مرسی از پاسخ دوستان.اینم کدی که برای دکمه ورود نوشتم
بعله علی جان.اون پسوورده.اشتباه تایپی بود.شما ببخشید!
اروری که میده دقیقا اینه:
the data types text and varchar are incompatible in the equal to the operator
USER user = new USER();
string username = usertxt.Text;
string password = passtxt.Text;
DBDataContext refahi = new DBDataContext(form3.Properties.Settings.Default.re fahiConnectionString);
try
{
user = (from t in refahi.USERs
where t.USERNAME == username && t.PASSWORD == password
select t).First();
if (user.ID > 0)
{
//logined
mainform mainfrm = new mainform();
mainfrm.Show();
}
else
{
MessageBox.Show("Wrong Username OR Password");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
MessageBox.Show("Wrong Username OR Password");
}