Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Mon, 30 Jun 2008 02:30:01 -0700,    group: microsoft.public.dotnet.languages.vb.data        back       


Mdb file not updating - VB 2008 Express   
I have created a new form project in vb 2008 express, and added a data-source 
pointing to a simple mdb file on my local hard drive at C:/DelMe.

If I open the data using the database explorer (rather than the datasource 
explorer) and right click on a table and retrieve the data, then I can see 
the data and update it from within vb, and changes are actually made to the 
data in the mdb file.

However, if a create either a data grid or bound text boxes which use the 
datasource and then run the application, changes show up in the application 
and are seemingly made (ie the datasource is being correctly updated), but 
these changes are not propagated back to the mdb file.

In the datsource explorer, the tableadapter has both fill() and getdata() 
listed, and the sql for update seems fine (as it does for the select method 
which works correctly).

Why are the changes not being propagated back to the mdb file, and how can I 
debug this ?

Thanks
date: Mon, 30 Jun 2008 02:30:01 -0700   author:   Ycrl

Re: Mdb file not updating - VB 2008 Express   
On Mon, 30 Jun 2008 02:30:01 -0700, Ycrl  wrote:

¤ I have created a new form project in vb 2008 express, and added a data-source 
¤ pointing to a simple mdb file on my local hard drive at C:/DelMe.
¤ 
¤ If I open the data using the database explorer (rather than the datasource 
¤ explorer) and right click on a table and retrieve the data, then I can see 
¤ the data and update it from within vb, and changes are actually made to the 
¤ data in the mdb file.
¤ 
¤ However, if a create either a data grid or bound text boxes which use the 
¤ datasource and then run the application, changes show up in the application 
¤ and are seemingly made (ie the datasource is being correctly updated), but 
¤ these changes are not propagated back to the mdb file.
¤ 
¤ In the datsource explorer, the tableadapter has both fill() and getdata() 
¤ listed, and the sql for update seems fine (as it does for the select method 
¤ which works correctly).
¤ 
¤ Why are the changes not being propagated back to the mdb file, and how can I 
¤ debug this ?

See if the following applies to your scenario:

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=427451&SiteID=1


Paul
~~~~
Microsoft MVP (Visual Basic)
date: Thu, 03 Jul 2008 10:39:18 -0500   author:   Paul Clement

Re: Mdb file not updating - VB 2008 Express   
Dear Paul (Mr Clement),

Thanks for the link.

But:
1) The mdb file is not included in the project, so the 'copy if newer/copy 
always/never copy' prioperty does not apply to the mdb file.
2) Does the update command have any relevance to the datagrid or to bound 
controls ? Doesn't vb do the updating automatically ?

Is this a bug (in which case it should be easily reproducible) or am I being 
stupid ?
How can I debug or solve this problem ?

Thanks in advance for your kind reply.

"Paul Clement" wrote:

> On Mon, 30 Jun 2008 02:30:01 -0700, Ycrl  wrote:
> 
> ¤ I have created a new form project in vb 2008 express, and added a data-source 
> ¤ pointing to a simple mdb file on my local hard drive at C:/DelMe.
> ¤ 
> ¤ If I open the data using the database explorer (rather than the datasource 
> ¤ explorer) and right click on a table and retrieve the data, then I can see 
> ¤ the data and update it from within vb, and changes are actually made to the 
> ¤ data in the mdb file.
> ¤ 
> ¤ However, if a create either a data grid or bound text boxes which use the 
> ¤ datasource and then run the application, changes show up in the application 
> ¤ and are seemingly made (ie the datasource is being correctly updated), but 
> ¤ these changes are not propagated back to the mdb file.
> ¤ 
> ¤ In the datsource explorer, the tableadapter has both fill() and getdata() 
> ¤ listed, and the sql for update seems fine (as it does for the select method 
> ¤ which works correctly).
> ¤ 
> ¤ Why are the changes not being propagated back to the mdb file, and how can I 
> ¤ debug this ?
> 
> See if the following applies to your scenario:
> 
> http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=427451&SiteID=1
> 
> 
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
>
date: Thu, 3 Jul 2008 09:53:01 -0700   author:   Ycrl

Re: Mdb file not updating - VB 2008 Express   
Ah, VB won't call update on its own. It can't/won't commit the data without 
you telling it to--regardless of the DBMS engine.

-- 
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205  (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________

"Ycrl"  wrote in message 
news:54157CB6-E2C4-4496-8E1C-7F4D3EBC61A7@microsoft.com...
> Dear Paul (Mr Clement),
>
> Thanks for the link.
>
> But:
> 1) The mdb file is not included in the project, so the 'copy if newer/copy
> always/never copy' prioperty does not apply to the mdb file.
> 2) Does the update command have any relevance to the datagrid or to bound
> controls ? Doesn't vb do the updating automatically ?
>
> Is this a bug (in which case it should be easily reproducible) or am I 
> being
> stupid ?
> How can I debug or solve this problem ?
>
> Thanks in advance for your kind reply.
>
> "Paul Clement" wrote:
>
>> On Mon, 30 Jun 2008 02:30:01 -0700, Ycrl  
>> wrote:
>>
>> ¤ I have created a new form project in vb 2008 express, and added a 
>> data-source
>> ¤ pointing to a simple mdb file on my local hard drive at C:/DelMe.
>> ¤
>> ¤ If I open the data using the database explorer (rather than the 
>> datasource
>> ¤ explorer) and right click on a table and retrieve the data, then I can 
>> see
>> ¤ the data and update it from within vb, and changes are actually made to 
>> the
>> ¤ data in the mdb file.
>> ¤
>> ¤ However, if a create either a data grid or bound text boxes which use 
>> the
>> ¤ datasource and then run the application, changes show up in the 
>> application
>> ¤ and are seemingly made (ie the datasource is being correctly updated), 
>> but
>> ¤ these changes are not propagated back to the mdb file.
>> ¤
>> ¤ In the datsource explorer, the tableadapter has both fill() and 
>> getdata()
>> ¤ listed, and the sql for update seems fine (as it does for the select 
>> method
>> ¤ which works correctly).
>> ¤
>> ¤ Why are the changes not being propagated back to the mdb file, and how 
>> can I
>> ¤ debug this ?
>>
>> See if the following applies to your scenario:
>>
>> http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=427451&SiteID=1
>>
>>
>> Paul
>> ~~~~
>> Microsoft MVP (Visual Basic)
>>
date: Thu, 3 Jul 2008 14:56:51 -0700   author:   William Vaughn [MVP]

Re: Mdb file not updating - VB 2008 Express   
Now I am completely confused.

I am using databound grids and databound controls. Are those not supposed to 
automatically perform the updates to the mdb file without any programmer or 
user intervention ?

Do your comments imply that there is an event into which I need to put some 
kind of VB instruction to tell VB to commit the data to the mdb file ? If so, 
which event and which VB instruction do I issue ?

Waiting for your kind help.
-------

"William Vaughn [MVP]" wrote:

> Ah, VB won't call update on its own. It can't/won't commit the data without 
> you telling it to--regardless of the DBMS engine.
> 
> -- 
> __________________________________________________________________________
> William R. Vaughn
> President and Founder Beta V Corporation
> Author, Mentor, Dad, Grandpa
> Microsoft MVP
> (425) 556-9205  (Pacific time)
> Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
> ____________________________________________________________________________________________
> 
> "Ycrl"  wrote in message 
> news:54157CB6-E2C4-4496-8E1C-7F4D3EBC61A7@microsoft.com...
> > Dear Paul (Mr Clement),
> >
> > Thanks for the link.
> >
> > But:
> > 1) The mdb file is not included in the project, so the 'copy if newer/copy
> > always/never copy' prioperty does not apply to the mdb file.
> > 2) Does the update command have any relevance to the datagrid or to bound
> > controls ? Doesn't vb do the updating automatically ?
> >
> > Is this a bug (in which case it should be easily reproducible) or am I 
> > being
> > stupid ?
> > How can I debug or solve this problem ?
> >
> > Thanks in advance for your kind reply.
> >
> > "Paul Clement" wrote:
> >
> >> On Mon, 30 Jun 2008 02:30:01 -0700, Ycrl  
> >> wrote:
> >>
> >> ¤ I have created a new form project in vb 2008 express, and added a 
> >> data-source
> >> ¤ pointing to a simple mdb file on my local hard drive at C:/DelMe.
> >> ¤
> >> ¤ If I open the data using the database explorer (rather than the 
> >> datasource
> >> ¤ explorer) and right click on a table and retrieve the data, then I can 
> >> see
> >> ¤ the data and update it from within vb, and changes are actually made to 
> >> the
> >> ¤ data in the mdb file.
> >> ¤
> >> ¤ However, if a create either a data grid or bound text boxes which use 
> >> the
> >> ¤ datasource and then run the application, changes show up in the 
> >> application
> >> ¤ and are seemingly made (ie the datasource is being correctly updated), 
> >> but
> >> ¤ these changes are not propagated back to the mdb file.
> >> ¤
> >> ¤ In the datsource explorer, the tableadapter has both fill() and 
> >> getdata()
> >> ¤ listed, and the sql for update seems fine (as it does for the select 
> >> method
> >> ¤ which works correctly).
> >> ¤
> >> ¤ Why are the changes not being propagated back to the mdb file, and how 
> >> can I
> >> ¤ debug this ?
> >>
> >> See if the following applies to your scenario:
> >>
> >> http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=427451&SiteID=1
> >>
> >>
> >> Paul
> >> ~~~~
> >> Microsoft MVP (Visual Basic)
> >>
date: Fri, 4 Jul 2008 03:08:00 -0700   author:   Ycrl

Re: Mdb file not updating - VB 2008 Express   
On Fri, 4 Jul 2008 03:08:00 -0700, Ycrl  wrote:

¤ Now I am completely confused.
¤ 
¤ I am using databound grids and databound controls. Are those not supposed to 
¤ automatically perform the updates to the mdb file without any programmer or 
¤ user intervention ?
¤ 
¤ Do your comments imply that there is an event into which I need to put some 
¤ kind of VB instruction to tell VB to commit the data to the mdb file ? If so, 
¤ which event and which VB instruction do I issue ?
¤ 

Basically you get all the plumbing when you use the wizard but yes the data modified in the DataSet
(via the DataGridView) isn't applied to the database until you supply the update code. So
essentially you have the option of when to perform the actual database update.

Is there an event you can use? Sure, take your pick. Do you want to use a button click event? A
DataGrid event? Some other event?

Your update statement would look something like the following:

        Me.Table_1TableAdapter.Update(Me.Db1_XPDataSet.Table_1)


Paul
~~~~
Microsoft MVP (Visual Basic)
date: Mon, 07 Jul 2008 15:07:19 -0500   author:   Paul Clement

Re: Mdb file not updating - VB 2008 Express   
With great thanks to Tim Anderson of PCW magazine in the UK, the data only 
gets sent back to the mdb file if you run the .update method of the relevant 
tableadapter !

This seems strange, as why has Microsoft gone to all the trouble of 
automating the Rapid Application Development (RAD) process of having bound 
controls and datagrids, whilst still requiring you to use code to commit the 
data ? A strange choice. But there it is.


"Ycrl" wrote:

> Now I am completely confused.
> 
> I am using databound grids and databound controls. Are those not supposed to 
> automatically perform the updates to the mdb file without any programmer or 
> user intervention ?
> 
> Do your comments imply that there is an event into which I need to put some 
> kind of VB instruction to tell VB to commit the data to the mdb file ? If so, 
> which event and which VB instruction do I issue ?
> 
> Waiting for your kind help.
> -------
> 
> "William Vaughn [MVP]" wrote:
> 
> > Ah, VB won't call update on its own. It can't/won't commit the data without 
> > you telling it to--regardless of the DBMS engine.
> > 
> > -- 
> > __________________________________________________________________________
> > William R. Vaughn
> > President and Founder Beta V Corporation
> > Author, Mentor, Dad, Grandpa
> > Microsoft MVP
> > (425) 556-9205  (Pacific time)
> > Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
> > ____________________________________________________________________________________________
> > 
> > "Ycrl"  wrote in message 
> > news:54157CB6-E2C4-4496-8E1C-7F4D3EBC61A7@microsoft.com...
> > > Dear Paul (Mr Clement),
> > >
> > > Thanks for the link.
> > >
> > > But:
> > > 1) The mdb file is not included in the project, so the 'copy if newer/copy
> > > always/never copy' prioperty does not apply to the mdb file.
> > > 2) Does the update command have any relevance to the datagrid or to bound
> > > controls ? Doesn't vb do the updating automatically ?
> > >
> > > Is this a bug (in which case it should be easily reproducible) or am I 
> > > being
> > > stupid ?
> > > How can I debug or solve this problem ?
> > >
> > > Thanks in advance for your kind reply.
> > >
> > > "Paul Clement" wrote:
> > >
> > >> On Mon, 30 Jun 2008 02:30:01 -0700, Ycrl  
> > >> wrote:
> > >>
> > >> ¤ I have created a new form project in vb 2008 express, and added a 
> > >> data-source
> > >> ¤ pointing to a simple mdb file on my local hard drive at C:/DelMe.
> > >> ¤
> > >> ¤ If I open the data using the database explorer (rather than the 
> > >> datasource
> > >> ¤ explorer) and right click on a table and retrieve the data, then I can 
> > >> see
> > >> ¤ the data and update it from within vb, and changes are actually made to 
> > >> the
> > >> ¤ data in the mdb file.
> > >> ¤
> > >> ¤ However, if a create either a data grid or bound text boxes which use 
> > >> the
> > >> ¤ datasource and then run the application, changes show up in the 
> > >> application
> > >> ¤ and are seemingly made (ie the datasource is being correctly updated), 
> > >> but
> > >> ¤ these changes are not propagated back to the mdb file.
> > >> ¤
> > >> ¤ In the datsource explorer, the tableadapter has both fill() and 
> > >> getdata()
> > >> ¤ listed, and the sql for update seems fine (as it does for the select 
> > >> method
> > >> ¤ which works correctly).
> > >> ¤
> > >> ¤ Why are the changes not being propagated back to the mdb file, and how 
> > >> can I
> > >> ¤ debug this ?
> > >>
> > >> See if the following applies to your scenario:
> > >>
> > >> http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=427451&SiteID=1
> > >>
> > >>
> > >> Paul
> > >> ~~~~
> > >> Microsoft MVP (Visual Basic)
> > >>
date: Mon, 7 Jul 2008 14:24:01 -0700   author:   Ycrl

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us