Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with '&' character, not able to update ID in SQL table

Status
Not open for further replies.

teenaguptha

Programmer
May 12, 2011
1
US
Hi all,

In my code, i have a ProductID which contains '&' character like "pen&pencil".I tried to update this as "pen&paper" from front end into database.But,database doesn't accept this changes..it remains as "pen&pencil"..Actually,I have created stored procedure for "update" and calling that in my code behind file.From front-end form , i'm entering new value and trying to update it. My code for update is as below -



@ProductID char(15),

@NewProductID char(15) = NULL,

Update ProductTable SET ProductID = @NewProductID WHERE ProductID = @ProductID

Please help me out.

Thanks in advance,



Teena
 
did you trace through your code? Are you sure you are passing the NEW value to your SP? Did you run the SP on it's own in SSMS to make sure it works as expected?
 
does it fail? if so what is the full exception (type, message, stack trace)?
what does your actual code look like. what you provided above is conceptual and doesn't help.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top