Results 1 to 7 of 7

Thread: Editing A Database In VB Express

  1. #1
    Senior Member crazyfool's Avatar
    Join Date
    Jan 2008
    Posts
    761
    Thanks
    77
    Thanked
    38 times in 38 posts
    • crazyfool's system
      • Motherboard:
      • Striker Extreme
      • CPU:
      • Q6600
      • Memory:
      • OCZ 6400 2 x 2GB
      • Storage:
      • Samsung Spinpoint 500GB
      • Graphics card(s):
      • BFG 8800 GT OC 512MB
      • PSU:
      • Coolermaster Real Power Pro 850w
      • Case:
      • Coolermaster CM-690
      • Operating System:
      • XP, Vista, Windows 7 & Ubuntu
      • Monitor(s):
      • Samsung 2232BW

    Editing A Database In VB Express

    I'm sure this is really simple but after having created a database within vb express 2008 I cannot work out how to edit the database. I have a series of text boxes which display the information from within the table and i want ot be able to edit the textboxes and then click on a button i have created and save the changes to the database. Anyone have any ideas?

  2. #2
    Senior Member
    Join Date
    Mar 2006
    Location
    London
    Posts
    296
    Thanks
    16
    Thanked
    8 times in 7 posts

    Re: Editing A Database In VB Express

    Do you want to edit it manually or create a form in your app that edits the database? Also what kind of database did you create? SQL, SQL Compact, Access?
    Last edited by gman1981; 07-04-2009 at 01:28 PM.

  3. Received thanks from:

    crazyfool (09-04-2009)

  4. #3
    Senior Member
    Join Date
    Sep 2007
    Posts
    409
    Thanks
    7
    Thanked
    32 times in 12 posts
    • icanhazburger's system
      • Motherboard:
      • Foxconn 946GZ7MA/946PL7MA Series
      • CPU:
      • DualCore Intel Core 2 Duo E6400
      • Memory:
      • 2 gig DDR2-667
      • Storage:
      • 320gig Baracuda II
      • Graphics card(s):
      • 7900 GS vc3600 cooler
      • PSU:
      • 600w
      • Case:
      • Something with a 25cm fan
      • Monitor(s):
      • 1 x 22"w 1 x 19"
      • Internet:
      • Pipex Max :(

    Re: Editing A Database In VB Express

    Easiest way would be data aware controls, I've always stayed away from them though in other languages.
    In the internets, no one can hear you sarcasm.

  5. Received thanks from:

    crazyfool (09-04-2009)

  6. #4
    Senior Member crazyfool's Avatar
    Join Date
    Jan 2008
    Posts
    761
    Thanks
    77
    Thanked
    38 times in 38 posts
    • crazyfool's system
      • Motherboard:
      • Striker Extreme
      • CPU:
      • Q6600
      • Memory:
      • OCZ 6400 2 x 2GB
      • Storage:
      • Samsung Spinpoint 500GB
      • Graphics card(s):
      • BFG 8800 GT OC 512MB
      • PSU:
      • Coolermaster Real Power Pro 850w
      • Case:
      • Coolermaster CM-690
      • Operating System:
      • XP, Vista, Windows 7 & Ubuntu
      • Monitor(s):
      • Samsung 2232BW

    Re: Editing A Database In VB Express

    I created the database within vbexpress so i'm not sure what kind it is :S ... and i will be using a form in the app to edit the databse... cheerz for the replies

  7. #5
    Senior Member crazyfool's Avatar
    Join Date
    Jan 2008
    Posts
    761
    Thanks
    77
    Thanked
    38 times in 38 posts
    • crazyfool's system
      • Motherboard:
      • Striker Extreme
      • CPU:
      • Q6600
      • Memory:
      • OCZ 6400 2 x 2GB
      • Storage:
      • Samsung Spinpoint 500GB
      • Graphics card(s):
      • BFG 8800 GT OC 512MB
      • PSU:
      • Coolermaster Real Power Pro 850w
      • Case:
      • Coolermaster CM-690
      • Operating System:
      • XP, Vista, Windows 7 & Ubuntu
      • Monitor(s):
      • Samsung 2232BW

    Re: Editing A Database In VB Express

    ok so far I have made the database in vb (.mdf database) and I think that when i click on my save button it seems the changes made to the database are saved to the dataset... but then when i close the form the changes are lost as they aren't applied to the database itself... I've been googling for days now and i cant find a simple way to do this... I think i have to write my own update methods but I have no idea how or if this is even how to do it.... does anybody have any ideas...plz...

    btw its vb.net

  8. #6
    Senior Member
    Join Date
    Sep 2007
    Posts
    409
    Thanks
    7
    Thanked
    32 times in 12 posts
    • icanhazburger's system
      • Motherboard:
      • Foxconn 946GZ7MA/946PL7MA Series
      • CPU:
      • DualCore Intel Core 2 Duo E6400
      • Memory:
      • 2 gig DDR2-667
      • Storage:
      • 320gig Baracuda II
      • Graphics card(s):
      • 7900 GS vc3600 cooler
      • PSU:
      • 600w
      • Case:
      • Something with a 25cm fan
      • Monitor(s):
      • 1 x 22"w 1 x 19"
      • Internet:
      • Pipex Max :(

    Re: Editing A Database In VB Express

    Quote Originally Posted by crazyfool View Post
    ok so far I have made the database in vb (.mdf database) and I think that when i click on my save button it seems the changes made to the database are saved to the dataset... but then when i close the form the changes are lost as they aren't applied to the database itself... I've been googling for days now and i cant find a simple way to do this... I think i have to write my own update methods but I have no idea how or if this is even how to do it.... does anybody have any ideas...plz...

    btw its vb.net
    This is how I've done it in past using a dataset and a OleDbDataAdapter

    myDS is the dataset and da is the OleDbDataAdapter

    Code:
            If myDS.HasChanges Then
                Try
                    myDS.Tables(0).GetChanges()
                    da.Update(myDS.Tables(0))
                Catch ex As Exception
                    myDS.RejectChanges()
                    MessageBox.Show(ex.ToString)
                End Try
            End If
    it should give you some pointers.
    In the internets, no one can hear you sarcasm.

  9. #7
    Registered+
    Join Date
    Jan 2009
    Posts
    50
    Thanks
    0
    Thanked
    5 times in 4 posts

    Re: Editing A Database In VB Express

    Hi,

    Always a good idea to post some of your code so that people can see what you already have in mind. That said its always good to post code in return to give a better explanation of a solution.

    Here is something I which I stumbled on when googling for VB.net and database just now

    http://www.itwriting.com/pcw/vbdotnetdata.php

    If you look at the the SchoolData class you should see how the save is handled. Dont worry if the rest of your application is different, this is just one way to do this.

    With regards to programming with data aware components.. though they may be quick to use, you'll quickly find that are limited as your experience grows. It much better to creata a class with you can use to load/save object to a database. If you search for database layer.. you should come across some links to help you get to grips with this.

    The reason I posted this link is that I thought you might benefit from seeing an example.

    Hope this helps, and good luck

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help me spec a 2 grand video editing system
    By ollie in forum General Discussion
    Replies: 12
    Last Post: 05-03-2007, 02:28 PM
  2. Apple Releases Final Cut Express HD 3.5
    By Bob Crabtree in forum HEXUS News
    Replies: 0
    Last Post: 18-05-2006, 05:57 PM
  3. FREE Visual Studio Express from M$
    By megah0 in forum Retail Therapy and Bargains
    Replies: 15
    Last Post: 12-11-2005, 02:28 PM
  4. VB Express Beta 2 Crash on startup
    By kidzer in forum Help! Quick Relief From Tech Headaches
    Replies: 0
    Last Post: 20-07-2005, 05:34 PM
  5. database and VB help
    By s4ch117 in forum Software
    Replies: 8
    Last Post: 09-02-2004, 01:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •