.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 30th, 2008, 01:55 PM
accessdanwi accessdanwi is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 48 accessdanwi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 42 m 50 sec
Reputation Power: 1
ASP.Net/VB.Net - Run an Append Query

Does anyone know how I would go about running an append query from a .Net page to an Access database? I know the basic syntax for writing to a table would be like this.
Code:
        Dim sqlString As String = "INSERT INTO Temp (WORLD_SEGMENT) VALUE (" & lstWS.SelectedItem.ToString() & ")"
        Dim sqlString As String = "INSERT INTO Temp (Test1,Test2) VALUES (?,?)"
        



        Using con As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("OppRptBE1.mdb") & ";")
            Using cmd As New OleDbCommand(sqlString, con)
                cmd.CommandType = CommandType.Text
                cmd.Parameters.AddWithValue("Test1", txtFirstName.Text)
                cmd.CommandType = CommandType.Text
                cmd.Parameters.AddWithValue("Test2", txtLastName.Text)

                con.Open()
                cmd.ExecuteNonQuery()
            End Using
        End Using


What I need to do is something like this
Code:
INSERT INTO TheValues ( Test1 )
SELECT Temp.Test1
FROM Temp
WHERE (((Temp.Test1)= strSelections));


strSelections contains values that were captured based on selections made in a List Box. Any help would be appreciated.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > ASP.Net/VB.Net - Run an Append Query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway