bool IsMatchedFound = false; SqlConnection con = new SqlConnection(); con.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\project\sample project\prject xample2 perfect\login\Database1.mdf;Integrated Security=True;User Instance=True"; try { con.Open(); string qry1 = "Select * from Table1 WHERE password = @password COLLATE SQL_Latin1_General_CP1_CS_AS and Username=@Username COLLATE SQL_Latin1_General_CP1_CS_AS"; SqlCommand com = new SqlCommand(qry1, con); com.Parameters.AddWithValue("@Username", this.usernamelabel.Text); com.Parameters.AddWithValue("@Password", this.textBox1.Text); SqlDataReader dr = com.ExecuteReader(); while (dr.Read()) { if (dr.HasRows == true) { IsMatchedFound = true; break; } } } catch (Exception) { MessageBox.Show("Error with the databse connection"); } con.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); }
this.Cursor = Cursors.WaitCursor;
//cursor activities is wait cursor Cursor = Cursors.WaitCursor; //cursor activities is default. Cursor = Cursors.Default;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)