Solved

Insert Statement

Posted on 2009-05-13
2
191 Views
Last Modified: 2012-05-06
I have the following insert statement that will not seem to work.  It worked fine until I added the "type" and the area of "this is a test".

How can I add text into a table field along with other values in a select?

Dim command7222 As New SqlClient.SqlCommand("INSERT INTO my_table(type, id5, change_id,send_date) values('" & "this is a test" & "','" & ("select ctl_num, id5_t, getdate() from my_table where ctl_num = '" & textbox1.Text & "')", myconn7222)
0
Comment
Question by:H-SC
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 24379414
please ty this:
Dim command7222 As New SqlClient.SqlCommand("INSERT INTO my_table(type, id5, change_id,send_date) SELECT '" & "this is a test" & "', ctl_num, id5_t, getdate() from my_table where ctl_num = '" & textbox1.Text & "' ", myconn7222)

Open in new window

0
 
LVL 1

Author Comment

by:H-SC
ID: 24379503
angelIII,

perfect!

many thanks for the quick reply
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question