Whenever I call this function to run this query....
public static void AddUsernameAndPassword()
{
SqlConnection connection = MedicalDB.EstConnection();
connection.Open();
string alterStatement = "ALTER TABLE PATIENT_TBL ADD USER_NAME VARCHAR(50) NULL," +
" PASSWORD VARCHAR(50) NULL";
SqlCommand alterCommand =
new SqlCommand(alterStatement, connection);
alterCommand.ExecuteNonQuery();
connection.Close();
}
through here
private void loginButton_Click(object sender, EventArgs e)
{
PatientDB.AddUsernameAndPassword();
//getPatient(1);
passTextBox.Text = patient.userName;
}
It tells me
Invalid column name 'USER_NAME'.
The properties are set accordingly. Please advise.