I want to show only specify database table in datagridview.I had use
dataGridView1.AutoGenerateColumns = false;
but i don't know how to add the column.For example on of the column is "attn_id".How should i add it?
here my code to connect database
private void tmst_timein_new_Load(object sender, EventArgs e)
{
try
{
using (TMPB_attn_DAL dalObj = new TMPB_attn_DAL())
{
dataGridView1.DataSource = dalObj.GetRecords().Cast<TMPB_attn>().ToList();
dataGridView1.Refresh();
}
}
catch (Exception es)
{
MessageBox.Show(es.Message);
}
}
And is this the only way to show specific table from database?