- private void UserInputKeyDown(object sender, KeyEventArgs e)
- {
- if (e.Key == Key.Enter)
- {
- string dbconnection = ConfigurationManager.ConnectionStrings["OverwatchDatabase"].ConnectionString;
- SqlConnection connection = new SqlConnection(dbconnection);
- connection.Open();
- if (connection.State == ConnectionState.Open)
- {
- MessageBox.Show("You have been successfully connected to the database!");
- SqlCommand Password_Hash = new SqlCommand("SELECT Password_Hash" + "From dbo.Authorized_Personnel", connection);
- bool Authenticate = BCrypt.Net.BCrypt.Verify(UserInput.Password, Password_Hash);
- if (Authenticate == true)
- {
- MessageBox.Show("Authentication Successful");
- connection.Close();
- mainscreen = new MainScreen();
- mainscreen.Show();
- this.Close();
- }
- else
- {
- MessageBox.Show("Authentication Failed");
- Application.Current.Shutdown();
- }
- }
- else
- {
- MessageBox.Show("Connection failed.");
- }
- }
- }
I'm having trouble authenticating against my sql server with bcrypt if anyone can help and explain what going on that would very much appreciated
its throwing an error at the moment saying cannot convert system.dat.sqlclinet.sqlcommand to string