1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| OleDbDataAdapter adapterDataGrid;
DataSet myDataset;
myDataset = new DataSet();
private void setDataGridViewList(String fundID)
{
try
{
adapterDataGrid = new OleDbDataAdapter("select ID, Date, Return, NAV, FundsManaged, StrategyAUM, BusinessAUM, Data, Estimate, LastUpdated, GrossLong, GrossShort, GrossTotal, Net, Vami, CumulatedReturn from Performance where ID=" + fundID + " order by Date;", conn);
if (myDataset.Tables["Datagrid"] != null)
{
myDataset.Tables["Datagrid"].Clear();
}
adapterDataGrid.Fill(myDataset, "DataGrid");
this.dataGridView_FundList.DataSource = myDataset.Tables["Datagrid"];
commandBuilderDataGrid = new OleDbCommandBuilder(adapterDataGrid);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
setStartAndEndDate();
this.dataGridView_FundList.DefaultCellStyle.BackColor = Color.Beige;
} |
Partager