When the user logs in they will be taken to a dashboard where they can select different options. one of them being "Account details". within this user control I've set up text boxes which will be filled with the users details once they double click on the row within the DataGridView .
I have a function which fills DataGridView and this has worked successfully throughout my application until now.
Does anyone know why this isn't working?
I have a function which fills DataGridView and this has worked successfully throughout my application until now.
C#:
public void FillingAccountDetails()
{
User_Control.Uc_updateAccountDetails ac = new User_Control.Uc_updateAccountDetails();
string query = "SELECT firstName, lastName, address, contactNumber, emailAddress, password FROM Customer WHERE emailAddress =' " + signInEmail.Text.Trim() + " ' AND password = ' " + SqlDataFunctions.hashPassword(signInPassword.Text.Trim()) + " ' ";
_IsqlDataFunctions.displayDataInGrid(query, ac.dataGridViewAccountDetails);
C#:
public void displayDataInGrid(string query, DataGridView datagrid)
{
try
{
DataTable dt = new DataTable();
connection.Open();
SqlDataAdapter adapter = new SqlDataAdapter(query, connection);
adapter.Fill(dt);
datagrid.DataSource = dt;
connection.Close();
}
catch (Exception message)
{
MessageBox.Show(message.Message);
}
}
Does anyone know why this isn't working?
Attachments
Last edited by a moderator: