473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

probleum in executing the update query

198 100+
hi
i am new in vb.net and using the following code for updating the record in database but it shows the error syntax error in update statment

the code is
squery = "Update LoginTb set password= '123' where password='sharma'"
dbCommand = New System.Data.OleDb.OleDbCommand(squery, dbConnection)
dbCommand = dbConnection.CreateCommand
dbCommand.CommandType = CommandType.Text
dbCommand.CommandText = squery
dbCommand.ExecuteNonQuery()
Aug 29 '08 #1
3 895
Shashi Sadasivan
1,435 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. squery = "Update LoginTb set password= \'123\' where password=\'sharma\'"
you should be using the escape characters to avoid the single quotes from giving exceptions

Please also post the exception that you are geting, so that we know what to look for !
Aug 29 '08 #2
Curtis Rutland
3,256 Expert 2GB
I didn't think that you can escape in VB.NET.

Post the error message.
Aug 29 '08 #3
Shashi Sadasivan
1,435 Expert 1GB
True, didnt realise that there were no semi colons at the end.
Can The poster please post more details about the error?
or has that been solved
Sep 4 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jerome | last post by:
Hi, I've got the following problem and I don't know how to make this (if it's possible at all): I want to make a form where the user can enter a criteria and then, after pushing a button or...
7
by: solidsna2 | last post by:
Hi, I am new to using SQL. I want to be able to exucute a query that I place in a view. I want this views to be executed every time a value change in one of the table in a particular field. ...
2
by: chets | last post by:
Hi All, I am facing problem in executing one dynamic query in PRO *C program on linux. I want to update table mytable by data MADURAI for a column mycolumn1 where primary key is myPK.I want to...
2
by: vasilip | last post by:
I am trying to use the XMLUPDATE stored procedure. Installed fine, and seems to work great if I execute the statement from a sql query using the controll center.. Doesn't work from java however. I...
7
by: wingsss | last post by:
i am currently using WindowsXP SP2 all updated apache 2.2.4 PHP 5.2.3 MySQL 5.0 and apache hang up when running this code //...
2
by: veer | last post by:
hello expert i made a website which opens in ie6 and works fine but when i open it in ie7 it creates probleum the probleum is that i have a footer in my webpage , it automatically moves in the...
2
by: progvar | last post by:
Hi! i have a query and i want to print the value of this query by programing. I use this query in ms-access and works fine but when i execute this query in visual basic it does't produce any error...
1
by: progvar | last post by:
H! i want to create a trigger in sql server 6.0 but i have a little bit of knowledge of creating trigger , the query i used for creating is create trigger reminder on student for insert,...
3
by: veer | last post by:
Hi i run this query it works fine Select Yp1VOp,count(*) as instrec into instrec from " & txttablename & " where Yp1EOp=Yp1VOp Group By Yp1EOp,Yp1Vop Order By Yp1EOp,Yp1VOp but when i put a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.