Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2006, 01:25 PM
kim kim is offline
Registered User
 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default save database

how do i save the items that i put into a database???
i have this code

       Me.Validate()
        Me.Table1BindingSource.EndEdit()
        Me.Table1TableAdapter.Update(Me.Database1DataSet.T able1)

but i get error (invaled extension)

 
Old March 31st, 2006, 12:51 AM
Registered User
 
Join Date: Mar 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to brookhou
Default

Try This:

On Error GoTo UpdateErr 'Checks for erros during updates
'This uses ADODC to update the database
datPrimaryRS.Recordset.UpdateBatch adAffectAll
  Exit Sub 'Closes Error Checking

UpdateErr: 'Error Checking Function
  MsgBox Err.Description 'Displays Error Message If Any Occur
 
Old April 2nd, 2006, 09:22 AM
kim kim is offline
Registered User
 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

get error

Error 1 Name 'datPrimaryRS' is not declared. C:\Documents and Settings\kim\Mijn documenten\Visual Studio 2005\Projects\Cataloog\Cataloog\stok.vb 11 9 Cataloog

Error 2 Name 'adAffectAll' is not declared. C:\Documents and Settings\kim\Mijn documenten\Visual Studio 2005\Projects\Cataloog\Cataloog\stok.vb 11 44 Cataloog


 
Old April 2nd, 2006, 09:26 AM
kim kim is offline
Registered User
 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

have this code now.
get no errors , but the data is not save'd

 Private Sub StokBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StokBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.StokBindingSource.EndEdit()
        Me.StokTableAdapter.Update(Me.Database1DataSet.sto k)



    End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
Save Listview Data to a DataBase ecabralrojas Beginning VB 6 0 June 30th, 2008 10:33 AM
i cannot save to my database knightneo Beginning PHP 3 January 29th, 2007 08:06 AM
save database kim Visual Basic 2005 Basics 0 March 20th, 2006 04:34 PM
How to i save checkbox value to database ADO guanxian VB Components 1 December 13th, 2005 06:19 PM
how to save an array to database say2x VB Databases Basics 0 November 8th, 2005 05:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.