Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 June 7th, 2007, 11:46 AM
Authorized User
 
Join Date: Dec 2006
Posts: 70
Thanks: 0
Thanked 1 Time in 1 Post
Default Using saved query to do update

I created a saved update query for one of my table adapters. But so far, I have figured out how to use it when I want to update data into my database.

This is what I am using:

Code:
    Private Sub subSaveData(ByVal sender As System.Object, _
        ByVal e As System.EventArgs)

        Me.Cursor = Cursors.WaitCursor
        Me.EquipmentTableAdapter.Connection.ConnectionString = APC_WirelessConnectionString

        Me.EquipmentTableAdapter.Update(Me.APC_WirelessDataSet.Equipment)
        Me.APC_WirelessDataSet.Equipment.Clear()

        Me.Cursor = Cursors.Default
    End Sub
How do I tell it to use my saved query command?

I am using a Windows form with four combo boxes and a datagridview.

This is the update command I want to execute:
        '"UPDATE Equipment " + _
        '"SET " + _
        '" LocationID = " & cmbLocation.SelectedValue & ", " + _
        '" StatusID = " & cmbStatus.SelectedValue & ", " + _
        '" OutColorID = " & cmbColor.SelectedValue & ", " + _
        '" OutCarrierID = " & cmbCarrier.SelectedValue & ", " + _
        '" user_update = '" & My.User.Name & "', " + _
        '" date_update = getdate()" + _
        '"WHERE ESN = '" & txtESN.Text & "';"


Thanks,
Karen





Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Query Help dalezjc Classic ASP Basics 8 March 18th, 2008 08:49 AM
Subform Record Saved, Update/Requery Form controls CB-VTXer Access VBA 2 August 6th, 2007 02:35 PM
I solved insert query.now see this Update Query. [email protected] VB.NET 2002/2003 Basics 2 September 21st, 2006 12:48 AM
Update query trab Access 1 May 11th, 2006 03:58 PM
update query leo_vinay SQL Server 2000 1 February 28th, 2006 09:55 AM





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