datagrid show if only table has one record
my datagrid show if only table has one record how can i solve it
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Carlos kambuiPosted May 8, 2015, 5:04 AM
Dipankar BiswasPosted May 8, 2015, 4:57 AM
try it..
private void all_data()
{
if (connectiondb.State == ConnectionState.Closed)
{
connectiondb.Open();
}
string all_data_query = "Select * from tbl_result";
OleDbCommand com = new OleDbCommand(all_data_query, connectiondb);
com.CommandType = CommandType.Text;
OleDbDataAdapter da = new OleDbDataAdapter(com);
DataTable dt = new DataTable();
da.Fill(dt);
this.dataGridView1.DataSource = dt;
connectiondb.Close();
}
only Change..
oledb to sql