Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Visual Basic 2010 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2010 Programmer's Reference by Rod Stephens; ISBN: 9780470499832
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2010 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 10th, 2012, 12:56 PM
Authorized User
Points: 51, Level: 1
Points: 51, Level: 1 Points: 51, Level: 1 Points: 51, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2012
Location: San Antonio, Texas
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help! Data access

Hi Rod,

Well I thought I could avoid making this post; but after several days of reading and trying out code I have to get help.

My problem is that I can not seem to update a table in the data base. This is what I have done:
1- I have a .mdb file that has six tables. ( Created and used with VB6).
2- In my .net project I sucessfully used the Data Source and loaded the .mdb fle and was able to view all the tables and their contents.
The data file name is MailList and one of the tables is named Category.
3- My Form1 has a Tab Control with several tabs.
4- The Second tab has a Button control and a Data Grid control with the following Properties:
DataSource set to CategoryTableBindingSource
EitMode set to EditOnKeyStroke
ReadOnly = False
SelectionMode = CellSelect

The DataGrid is setup to show only one column.

5- The Data Set name = Mail_ListDataSet
6- The Table Adapter name = CategoryTableTableAdapter
7- The CategoryTableBindingSource DataMember = CategoryTable and the DataSource = Mail_ListDataSet.

8- The button's click event has the following code:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Mail_ListDataSet.CategoryTable.AcceptChanges()
        CategoryTableTableAdapter.Update(Mail_ListDataSet.CategoryTable)
    End Sub
When I run the proram with Debug (and also in the distributed version) the DataGrid does get loaded and all the rows are displayed. I can edit the rows and also add rows; however when I click the SAVE buton the changes are not transfered to the data base file.

My VB.net is the 2010 Express version!

What am I doing wrong?
(This VB.net reminds me of COBOL, a writers cramp language; I am glad the VB.net has the IntelliSense)

Martin

Last edited by toconce; July 10th, 2012 at 01:03 PM. Reason: format attached code
Reply With Quote
  #2 (permalink)  
Old July 11th, 2012, 01:46 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,145, Level: 23
Points: 3,145, Level: 23 Points: 3,145, Level: 23 Points: 3,145, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 641
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Hi Martin,

From your description I can't think what's wrong. It sounds like you're doing basically the right things.

If you email me the program at RodStephens@vb-helper.com I'll take a look.

Quote:
(This VB.net reminds me of COBOL, a writers cramp language; I am glad the VB.net has the IntelliSense)
I agree! I think if it weren't for IntelliSense it wouldn't be as verbose. But to get the full advantage of the self-documenting command style, you do need to get used to using IntelliSense to type things for you.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access: Data Access Page sevp95 Access VBA 0 July 14th, 2008 12:07 PM
Please Help! Ms Access Data Access Pages Iashia06 Access 0 May 4th, 2006 04:29 PM
SQL Access/ASP.NET data access issue saeta57 SQL Server ASP 1 July 4th, 2004 05:29 PM
SQL Access/ASP.NET data access issue saeta57 Classic ASP Databases 1 July 4th, 2004 04:32 PM
Data access page access problem :) kev_79 Access 0 September 4th, 2003 05:02 PM



All times are GMT -4. The time now is 03:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.