datagridview did not show all data of database it only show one data.
DataTable dt = new DataTable();
dt = blcat.getallcategory();
if (dt.Rows.Count > 0)
{
dataGridView1.Rows.Add();
dataGridView1.Rows[i].Cells["calcategory_id"].Value = dt.Rows[0]["category_id"].ToString();
dataGridView1.Rows[i].Cells["calcategory"].Value = dt.Rows[0]["category_name"].ToString();
i++;
}
7 Replies
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.
Ranjit PowarPosted Jan 20, 2016, 5:52 AM
Yves LarockPosted Jan 20, 2016, 5:58 AM
Vipul MalhotraPosted Jan 20, 2016, 5:58 AM
Yves LarockPosted Jan 20, 2016, 5:42 AM
Abdu RafeeqPosted Jan 20, 2016, 5:22 AM
Ranjit PowarPosted Jan 20, 2016, 5:18 AM
Abdu RafeeqPosted Jan 20, 2016, 5:16 AM