Solved

Insert Statement

Posted on 2009-05-13
2
185 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 142

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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