title: How to get salt from MySql database using Asp.net?
body: <p>How can I retrieve salt from MySql database using Asp.Net ?</p>
  
  <p>I want to use that retrieved salt to add to the user entered password to generate an SHA256 hash and then authenticate the user.</p>
  
  <p>Here is what I am trying to do to fetch the salt:</p>
  
  <pre><code>String userNameEntered = UserN_TextBox.Text;
  String passwordEntered = Password_TextBox.Text;
  String connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
  connection = new MySqlConnection(connectionString);
  connection.Open();
  MessageBox.Show("Successfully connected to database");
  String queryString = "select salt from xyz.abc_table where salt = @Salt";
  command = new MySqlCommand(queryString, connection);
  command.Parameters.AddWithValue("@Salt", queryString);
  reader = command.ExecuteReader();
  Response.Write("Salt retrived is" + reader);
  reader.Close();
  connection.Close();
  </code></pre>
  
  <p>When I execute this code, it returns the MySql Data Reader library rather than the salt in the database....</p>
  
  <p>Thanks in advance... :) </p>