Select Query不会在DataGridView中显示数据

时间:2014-12-07 14:05:54

标签: c# sql data-binding datagridview datasource

我有2个datagridview我需要将数据从一个带到另一个带有rowindex和查询的问题我有一个问题,查询没有显示其写入的数据为空

void dataGridViewDoses_CellClick(object sender, DataGridViewCellEventArgs e)
{
    RowIndex = int.Parse(e.RowIndex.ToString());
    int categoryId = (int)this.comboBoxCategoryOrders.SelectedValue;
    dataGridViewDoseOrders.DataSource = Dose.GetDoseOrder(categoryId, RowIndex);
}

public static DataTable GetDoseOrder(int CategoryID, int RowIndex)
{
    string strSql = string.Format("SELECT DoseName, Price, CategoryID, ImageUrl FROM TblDose WHERE(CategoryID = {0})AND(RowIndex = {1})", CategoryID, RowIndex);
    return DAL.GetDataTable(strSql);
}

CategoryID和RowIndex显示true值但不显示数据

0 个答案:

没有答案