المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : need help



C# Programming
07-10-2009, 11:25 AM
Hi,

this is my coding
--------------------------------------------------------------------
while (odr.Read())
{
if (usr.Text == odr["userid"].ToString())
{
MessageBox.Show("User Login", "Information", MessageBoxButtons.OK);
}
else
{
DialogResult drsave = MessageBox.Show("Login Fail", "Erorr", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
if (drsave == DialogResult.OK)
{
usr.Text = "";
pass.Text = "";
usr.Focus();
}
else
this.Close();
}
}
------------------------------------------------------------------------
My program Build Successfully but when i type in textbox any string value my program read every value in my database in give every time message.
for example in my database have 5 records my program read this records in give message 5 time http://www.barakasoft.com/script/Forums/Images/smiley_sigh.gif
i want my program check all records in give one message record found or not
please give me solution

thanks in advanc

jawad khatri
i want to