Re: Force Requery by William
William
Thu Jul 08 12:42:58 CDT 2004
You are invoking fill each time. This gets called every single time
(Page.IsPostBack && !Page.IsPostBack ?)
--
W.G. Ryan, eMVP
Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
"Chris Kennedy" <chrisknospam@cybase.co.uk> wrote in message
news:OOANeLQZEHA.3688@TK2MSFTNGP12.phx.gbl...
> Everytime the page loads I use this code. It doesn't refresh the
> dropdownlist (autopostback on true and false). When I submit the form
which
> posts stuff to a database table etc the dataadapter doesn't update. I
> thought by doing this I was invoking the fill method. Confused :)
> What do I do to force the dataadapter to update on every page load as it
> would in classic ADO.
>
> Dim dsProducts As New Data.DataSet()
> SqlDataAdapter1.Fill(dsProducts)
> drpProducts.DataTextField = "CMSDESCRIPTION"
> drpProducts.DataValueField = "CMSID"
> drpProducts.DataSource = dsProducts
> drpProducts.DataBind()
>
>
> "William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
> news:%238SuVROZEHA.1448@TK2MSFTNGP12.phx.gbl...
> > If you have new data you are going to have to call Fill on the
dataAdapter
> > again
> >
> > --
> >
> > W.G. Ryan, eMVP
> >
> > Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
> > Let Microsoft know!
> > https://www.windowsembeddedeval.com/community/newsgroups
> > "Chris Kennedy" <chrisknospam@cybase.co.uk> wrote in message
> > news:O7OMfKOZEHA.2432@tk2msftngp13.phx.gbl...
> > > In my page load I am automatically filling the dataset from the
> > dataadapter
> > > the dataadapter. Is there a fill method for the data adapter as well?
> > >
> > >
> > > "Miha Markic [MVP C#]" <miha at rthand com> wrote in message
> > > news:%23uW5htNZEHA.4092@TK2MSFTNGP11.phx.gbl...
> > > > Hi Chris,
> > > >
> > > > "Chris Kennedy" <chrisknospam@cybase.co.uk> wrote in message
> > > > news:ugZQ8YNZEHA.712@TK2MSFTNGP11.phx.gbl...
> > > > > I have a dropdownmenu which is databound to a table via a
> dataadapter
> > > and
> > > > > dataset.
> > > >
> > > > Actually it is bound to dataset and not to adapter.
> > > >
> > > > A control on another part of the form updates the same table in the
> > > > > database. On postback the dropdown does not show the new record. I
> > have
> > > > > tried the autopost back on true or false. I am assuming the
dataset
> is
> > > > > remaining disconnected.
> > > >
> > > > Dataset is always disconnected.
> > > >
> > > > Is there an easy way to get the dataadapter to
> > > > > requery itself.
> > > >
> > > > Fill method? But it is you that have to invoke the method - it won't
> do
> > it
> > > > automatically.
> > > >
> > > > --
> > > > Miha Markic [MVP C#] - RightHand .NET consulting & development
> > > > miha at rthand com
> > > > www.rthand.com
> > > >
> > > >
> > >
> > >
> >
> >
>
>