Home All Groups Group Topic Archive Search About

How to re-fill a data grid?

Author
18 Oct 2005 2:47 PM
Snake
I have a vb .net program which fills a data grid upon form load from an
acccess database.  This works great.  Now, I have to add a combo box and use
it to alter the underlying sql statement and re-fill the data grid.  I have
never done this before, but I created a new sql statement in strSql from the
combobox, update the data adapter, and try to fill the data grid.  The
program halts on the Fill with no particular explanation or complaint that I
can determine.  Something tells me that I have to do something else before
the Fill from the dataset.  Any suggestions?

Thanks,

Michael
Ex.
..
..
..
    daXtreme.SelectCommand.CommandText = strSql.ToString

'    Fill the data grid using the new Sql command. . .

    Me.daXtreme.Fill(dsXtreme)

End Sub

Author
18 Oct 2005 2:51 PM
Grant
opps wrong group. try microsoft.public.dotnet.general.



Show quoteHide quote
"Snake" <Sn***@discussions.microsoft.com> wrote in message
news:2457BAB5-8132-40FD-A518-EEF0ABA437C1@microsoft.com...
>I have a vb .net program which fills a data grid upon form load from an
> acccess database.  This works great.  Now, I have to add a combo box and
> use
> it to alter the underlying sql statement and re-fill the data grid.  I
> have
> never done this before, but I created a new sql statement in strSql from
> the
> combobox, update the data adapter, and try to fill the data grid.  The
> program halts on the Fill with no particular explanation or complaint that
> I
> can determine.  Something tells me that I have to do something else before
> the Fill from the dataset.  Any suggestions?
>
> Thanks,
>
> Michael
> Ex.
> .
> .
> .
>    daXtreme.SelectCommand.CommandText = strSql.ToString
>
> '    Fill the data grid using the new Sql command. . .
>
>    Me.daXtreme.Fill(dsXtreme)
>
> End Sub
>
Author
18 Oct 2005 2:59 PM
Ralph
Show quote Hide quote
"Snake" <Sn***@discussions.microsoft.com> wrote in message
news:2457BAB5-8132-40FD-A518-EEF0ABA437C1@microsoft.com...
> I have a vb .net program which fills a data grid upon form load from an
> acccess database.  This works great.  Now, I have to add a combo box and
use
> it to alter the underlying sql statement and re-fill the data grid.  I
have
> never done this before, but I created a new sql statement in strSql from
the
> combobox, update the data adapter, and try to fill the data grid.  The
> program halts on the Fill with no particular explanation or complaint that
I
> can determine.  Something tells me that I have to do something else before
> the Fill from the dataset.  Any suggestions?
>
> Thanks,
>
> Michael
> Ex.
> .
> .
> .
>     daXtreme.SelectCommand.CommandText = strSql.ToString
>
> '    Fill the data grid using the new Sql command. . .
>
>     Me.daXtreme.Fill(dsXtreme)
>
> End Sub
>

Standard, non satisfactory answer...
--
<response type="generic" language="VB.Net">
This newsgroup is for users of Visual Basic version 6.0
and earlier and not the misleadingly named VB.Net
or VB 200x.  Solutions, and often even the questions,
for one platform will be meaningless in the other.
When VB.Net was released Microsoft created new newsgroups
devoted to the new platform so that neither group of
developers need wade through the clutter of unrelated
topics.  Look for newsgroups with the words "dotnet" or
"vsnet" in their name.  For the msnews.microsoft.com news
server try these:

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.dotnet.framework.adonet
microsoft.public.dotnet.framework.windowsforms.controls
microsoft.public.dotnet.framework.windowsforms.databinding

</response>