about SQL statement in vb

  • Thread starter Thread starter 2
  • Start date Start date
2

2

Remove the single quotes.... assuming mem_id is not a char or string
datatype...

dim comm as new oledbcommand("select * from table_name where mem_id=" &
gelen)
 
Hello,
There is problem with my sql query which is the following :
dim comm as new oledbcommand(" select * from table_name where mem_id="' &
gelen & '" ")

gelen and mem_id variable is integer. is the defination wrong ?

When I change the query like that ( " select * from table_name where mem_id=
5 ")
there is no problem.
Please help...


--
UGUR EKÝNCÝ

OLCSAN GROUP
Nazmi Akbacý ÝþMerkezi
No . 61 Maslak / ISTANBUL
Tel. +90 212 2851818
Fax. +90 212 2851717
WEB: www.olcsancad.com
e-mail : (e-mail address removed)
 
Hi,

Try

dim comm as new oledbcommand(" select * from table_name where mem_id=" &
gelen)

Tim
 
Hi Ugur,

I think you can delete the single quote, that is for a string"

As it is now it should give an error on the _id "' because that has if it is
a string to be '" (single quote, double quote)

I hope this helps?

Cor
 
* "ugurceng said:
There is problem with my sql query which is the following :
dim comm as new oledbcommand(" select * from table_name where mem_id="' &
gelen & '" ")

gelen and mem_id variable is integer. is the defination wrong ?

Remove the "'" characters from your SQL command string.
 
Back
Top