I'm trying to figure out how can i send two items (Up and down inside a column) from sql server.
Here is my existing code:
SqlDataAdapter sda = new SqlDataAdapter(" SELECT name,Subname,Code,Price from Customers", con);
DataTable dt = new DataTable();
sda.Fill(dt);
AppointmentGrid.Rows.Clear();
foreach (DataRow item in dt.Rows)
{
int n = AppointmentGrid.Rows.Add();
AppointmentGrid.Rows[n].Cells[0].Value = item[0].ToString();
AppointmentGrid.Rows[n].Cells[1].Value = item[1].ToString();
AppointmentGrid.Rows[n].Cells[2].Value = item[2].ToString();
AppointmentGrid.Rows[n].Cells[3].Value = item[3].ToString();
}
I need 'Name' and 'Subname' to be inside one column in my datagridview.