Solved

Insert Statement

Posted on 2009-05-13
2
163 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
Comment Utility
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
Comment Utility
angelIII,

perfect!

many thanks for the quick reply
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now