[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using a variable in a database string

Posted on 2007-08-10
1
Medium Priority
?
158 Views
Last Modified: 2013-11-05
How do I write a select statement with a variable?

In VB it would be

dim strString as string
strQuery = "select * from tblName where colName like '" & strString & "'"
0
Comment
Question by:Mike Miller
1 Comment
 
LVL 12

Accepted Solution

by:
andrewjb earned 80 total points
ID: 19671470
errr....

string str = "123";
string qry = "select * from tblName where colname like '" + str + "'"

?
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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

868 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