473,771 Members | 2,347 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADO.NET 2.0 Question - LearnVisualStud io.Net tutorial

I ran though the ADO.NET tutorials on www.LearnVisualStudio.Net (also
available from msdn.microsoft. com) for VB 2005 - specifically lesson 9 of
"Visual Basic 2005 Express Edition for Beginners"
To my dismay, after following the tutorial a couple of times, it ends with
the presenters app functioning correctly while mine does not. The issue is
that when we execute the following code to save changes to the database,
then close the app and restart, my changes are not saved while his
apparently are.
------------------------------------------------
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

'need to get any changes that were made to the bindings source and place in
dataset

Me.BindingSourc e1.EndEdit() 'propagates changes made to data on form to
dataset

Dim rowsaffected As Integer = 0

rowsaffected = CustomerTableAd apter1.Update(M yCompanyDataSet 1.Customer)
'updates database and returns number of rows updated

MessageBox.Show (rowsaffected.T oString)

End Sub

-------------------------------------------

The author of the tutorial was working with Beta 2 so I'm not sure if there
is something missing in the tutorial or perhaps someting I missed twice
while following along.
Any tips on what may be missing are greatly appreciated.

-m
Dec 29 '05 #1
3 1331
Mike,

Me.BindingSourc e1.EndEdit() 'propagates changes made to data on form to
dataset


Probably this has to be EndCurrentEdit because that propogates changes made
to data on a form to a dataset.

I hope this helps,

Cor
Dec 29 '05 #2
Unfortunately, the EndCurrentEdit method does not exist in this context.
ms-help://MS.VSExpressCC. v80/MS.NETFramework .v20.en/cpref17/html/T_System_Window s_Forms_Binding Source_Members. htm
-m

"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:el******** *****@TK2MSFTNG P09.phx.gbl...
Mike,

Me.BindingSourc e1.EndEdit() 'propagates changes made to data on form to
dataset


Probably this has to be EndCurrentEdit because that propogates changes
made to data on a form to a dataset.

I hope this helps,

Cor

Dec 29 '05 #3
Mike,
Unfortunately, the EndCurrentEdit method does not exist in this context.


That was why I wrote probably.

Normally we do it in this way.

BindingContext( ds.Tables(0)).E ndCurrentEdit()

Where ds.Table(0) represent your table or defaultview of that.

(There are in my opinion still many flaws in the documentation, there is
told that it is one of the major goals to get rid of those, so I am not sure
if this is one, however the EndEdit has never done what you told it should
do.).

http://msdn2.microsoft.com/en-us/lib...d.endedit.aspx

while this does it.

http://msdn2.microsoft.com/en-us/lib...rrentedit.aspx

Probably will this do it as well

BindingContext( directcast(Bind ingSource1,Data Table)).EndCurr entEdit
and if this gives an error than
BindingContext( directcast(Bind ingSource1,Data View)).EndCurre ntEdit

You tell than what object in the bindingsource is affected and do using the
bindingcontext an endcurrentedit on it.

All typed nothing tested so watch errors.

I hope this helps,

Cor
Dec 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2932
by: Rhino | last post by:
Can anyone point me to a good free XSLT Tutorial online? I looked for some a few months ago and didn't find anything very good. I'm hoping some of the experts here can point me to a good XSLT tutorial..... -- Rhino --- rhino1 AT sympatico DOT ca "There are two ways of constructing a software design. One way is to make it
15
4230
by: binnyva | last post by:
Hello Everyone, I have just compleated a JavaScript tutorial and publishing the draft(or the beta version, as I like to call it) for review. This is not open to public yet. The Tutorial is avaliable at... http://www.geocities.com/binnyva/code/javascript/advanced_tutorial/ If any of you could spare the time, please have a look at my tutorial
18
1956
by: Xah Lee | last post by:
i've started to read python tutorial recently. http://python.org/doc/2.3.4/tut/tut.html Here are some quick critique: quick example: If the input string is too long, they don't truncate it, but return it unchanged; this will mess up your column lay-out but that's usually better than the alternative, which would be lying about a value. (If you really want truncation you can always add a slice operation, as in
2
1362
by: ornot2b | last post by:
Learnvisualstudio.net web site Although the information on this site is very helpful and I have gained from being a subscriber, I think that their support area is very poor. They provide two means to contact them - nonemergency@learnvisualstudio.net and emergency@learnvisualstudio.net > On Nov 27 I sent an email to the non-emergency address. No Response! I then sent another email to the non-emergency address on the 3, 6, 11, and 15 of...
11
2936
by: Magnus Lycka | last post by:
While the official Python Tutorial has served its purpose well, keeping it up to date is hardly anyones top priority, and there are others who passionately create really good Python tutorials on the web. I think 'A Byte of Python' by Swaroop C H is a good beginners tutorial, and 'Dive Into Python' by Mark Pilgrim is a good tutorial for more experienced programmers.
4
1511
by: Liz | last post by:
Anyone have any opinions on the videos at www.learnvisualstudio.net ? Thanks ... L
2
2712
by: minipostbil | last post by:
Really want this, would be very glad if someone could help.. i´m most interested in the C# videos and how to use visualstudio videos..
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.