Here is my table. patient table
I want the first and last name to be combined as a "name" in a datagridview, how can I do this?
here is my conclusion my conclusion is datagridview
And my code ..
private void frmPatient_Load(object sender, EventArgs e)
{
MySqlConnection con = new MySqlConnection("server = localhost; database = nuclinic; username = root; password = ; Convert Zero Datetime=True");
string query = "select firstname, lastname from patient";
using (MySqlDataAdapter adpt = new MySqlDataAdapter(query, con))
{
DataSet dset = new DataSet();
adpt.Fill(dset);
dataGridView1.DataSource = dset.Tables[0];
}
con.Close();
}
I tried this code "SELECT firstname + ', ' + lastname AS name"; but it does not work
user8647100
source
share