[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Insert Statement

Posted on 2009-05-13
2
Medium Priority
?
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

650 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