I want to get the FullName
when the user login succesfully and put their FullName
to the label
string conn = ConfigurationManager.ConnectionStrings["SystemDatabase"].ConnectionString;
SqlConnection sqlconn = new SqlConnection(conn);
sqlconn.Open();
string query = "Select * from UserAccount where Username = '" + txtUsername.Text.Trim() + "' and Password = '" + txtPassword.Text.Trim() + "'";
SqlDataAdapter sda = new SqlDataAdapter(query,sqlconn);
DataTable dt = new DataTable();
sda.Fill(dt);
if (dt.Rows.Count == 1)
{
FrmPOS frm = new FrmPOS();
frm.Show();
frm.lblCashierName.Text = ?//here i want to display the fullname from the UserAccount table.
this.Hide();
}
I don't know how to get the data from the DataTable
. Or is there any other way to do it?