An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Hi @Mohamed Rafi N ,
I think your userid and password are unique. So I suggest you could count the same userid and the password. If the count is more than 1, you could login in.
string strSql = "SELECT COUNT(*) from login where userid=@userid and password=@password";
cmd.Connection = cnn;
cnn.Open();
int count = Convert.ToInt32(command.ExecuteScalar());
if (count >= 1)
MessageBox.Show("Login Successfully");
else
MessageBox.Show("Please register");
Best regards,
Yijing Sun
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.