473,387 Members | 1,834 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,387 software developers and data experts.

SQL query syntax for updating database asp.net c#

19
Hello,

Could anyone please check the basic syntax of this query and let me know if its correct? Basically I am trying to update the email Id of a user whose username is contained within the variable 'userName' and the new Email is within 'NewEmail'.



Expand|Select|Wrap|Line Numbers
  1. string cmdText = "UPDATE Users SET EmailId ='" + NewEmail + "' WHERE UserName ='" + userName + "'";
Thanks
May 1 '11 #1

✓ answered by Marknut

Yes, that’s correct as long as the EmailId is a text field and not a number.

2 3694
Marknut
42
Yes, that’s correct as long as the EmailId is a text field and not a number.
May 9 '11 #2
kino
19
Yep, its text, thanks for the answer! :)
May 10 '11 #3

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

Similar topics

1
by: lev | last post by:
Hello, Is there an ad hoc way to query a remote database in Oracle a la OPENROWSET statement in MS SQL? Thank you. Lev
2
by: Craig Stadler | last post by:
Im trying to write a like query select * from table1 where column1 like 'abc%' (I realize this syntax isnt correct) I want to include any chars from 0-9 in that spot... Does anyone know how...
20
by: xixi | last post by:
hi, we use db2 udb v8.1 on windows, i am trying to use federated database objects to create wrapper, even though i have update dbm cfg using federated yes, i still get error "the instance for the...
1
by: Dalan | last post by:
I'm experiencing a Query Syntax Error with an Access 97 Db. Actually, the query performs as expected when adding any new records or editing existing ones and even deleting records, EXCEPT when the...
0
by: seanseaghan | last post by:
New to this group, so greetings all! I am trying to develop query syntax in Access 2000 to accomplish the following: Imagine you are in an accounting dept. and you are working on a...
0
by: Thread77 | last post by:
Hello I'm new to ASP.NET and am working on a web page where I have several textboxes that are bound to a table in a dataset. I'm able to query my SQL database, use a SQLAdapter to fill the table...
0
by: info | last post by:
i researched for a while on the net and found that more people have this problem, but could not get an answer. i am very new to MySql. linux - feudora i log into mysql using "root" when...
2
by: Rshah | last post by:
sql query syntax? i write this query but error get : column not found how can i write ? SELECT c.stock_cat_name, a.stock_code, c.description, a.date, IIF(MID(a.type,2,1)="I",SUM(a.quantity),0)...
21
by: missflorenceokosun | last post by:
hi, am florence. i keep having a runtime error stating error in update query syntax. i have looked through my code over and over gain and seem to find no flaw. i need you guys to help me out! ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.