hi,
I'm using access db in my c# program I have a select query and I want to present
the result in data grid view ,I succeed doing that with this while loop
Code: ( c )
int i = 0,j=0;
while (dbReader.Read( ))
{
dataGridView2.R ows.Add();
dataGridView2[j, dataGridView2.R ows.Count - 1].Value = (string) [ dbReader.GetVal ue(0).ToString( ); j++;
dataGridView2[j, dataGridView2.R ows.Count - 1].Value = (string)dbReade r.GetValue(1); j++;
dataGridView2[j, dataGridView2.R ows.Count - 1].Value = (string)dbReade r.GetValue(2);
i++;
j = 0;
}
is there an appropriate way doing it that sent the all result to the table at once?
thanks,
I'm using access db in my c# program I have a select query and I want to present
the result in data grid view ,I succeed doing that with this while loop
Code: ( c )
int i = 0,j=0;
while (dbReader.Read( ))
{
dataGridView2.R ows.Add();
dataGridView2[j, dataGridView2.R ows.Count - 1].Value = (string) [ dbReader.GetVal ue(0).ToString( ); j++;
dataGridView2[j, dataGridView2.R ows.Count - 1].Value = (string)dbReade r.GetValue(1); j++;
dataGridView2[j, dataGridView2.R ows.Count - 1].Value = (string)dbReade r.GetValue(2);
i++;
j = 0;
}
is there an appropriate way doing it that sent the all result to the table at once?
thanks,
Comment