Datagrid show if only table has one record
my datagrid show if only table has one record how can i solve it
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dipankar BiswasRank #992 · 2K reputationPosted May 8, 2015, 12:57 AM EDT
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
Carlos kambuiRank #2,642 · 528 reputationPosted May 8, 2015, 1:04 AM EDT