Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / July 2007

Tip: Looking for answers? Try searching our database.

Adding New Record - SQL Expres DB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Miro - 30 Jun 2007 04:02 GMT
vb.net 2005 express

I havnt posted in a while but I have been busy doing the tutorials on the
SQL Express and the first VB.net videos.
( Basically started from scratch and gave up the idea of mdb tables and
moving to SQL Express ).

One thing I cant seem to find / figure out is this.

I have dragged a table onto my form which in term binded everything for me
and also put a navigator.
Lets say this table has
   ID ( unique key ) - Auto Increment
   Name varchar(20) - not nullable

Then I added the Name field to the form as well ( so its binded as well).

As i click on teh add buttons on the binding navigator, the field i added
also updates.
If I click on the add button within the binding navigator, the field in the
datagrid jumps to the bottom with a
new 'ID' that has been autoincremented and the Name field is blank awaiting
input.

I can now either edit the field in the datagrid or the field.
Once I do this - i click save and all is well.

How do I 'code' the add button manually in a command button.
I cant seem to figure out how to look at the binding navigators code.
   -so everything "blanks" on the textboxes, the navigator goes to the
bottom and ready for input.

Thanks

Miro
Miro - 03 Jul 2007 13:48 GMT
I got it,

Very simple, once you can get through the help files no express

       Me.BindingSourceName.AddNew()

This throws the datagrid into an add mode and at the same time clears all
your binded text boxes.

and to save,
       Me.Me.BindingSourceName.AddNew.EndEdit()
       Me.TableAdapterName.Update(Me.DataSetName.TableName)

Cheers'

Miro

> vb.net 2005 express
>
[quoted text clipped - 31 lines]
>
> Miro

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.