Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

try

 


Dim myStr as String="5"
dim query as  String

query="SELECT * FROM somewhere WHERE something= " & myStr 

Some people are wise and some are other-wise.
Posted
String myStr="4";
String myQuery;
myQuery="SELECT * FROM somewhere WHERE something=" + myStr;

Some people are wise and some are other-wise.
Posted

more complex --->

 

String myStr ="Customers";
String myStr1="4";
String myStr2="id";
String myQuery;

myQuery="SELECT * FROM" + myStr + " WHERE " + myStr2 + "=" +myStr1;

Some people are wise and some are other-wise.
Posted

However if you use a string you should quote it thus:

 


Dim myStr As String="5"
Dim query As  Stringquery="SELECT * FROM somewhere WHERE something= '" & myStr & "'"

My website
Posted

Yes, i forgot qoutes!!!

Thanks hog!

 

String myStr ="Customers";
String myStr1="4";
String myQuery;

myQuery="SELECT * FROM" + myStr + " WHERE id ='" + myStr1 + "'";

Some people are wise and some are other-wise.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...