Click here to Skip to main content
11,934,783 members (50,782 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# VB VB.NET
here's my script

    <script>insert into POMOD_Q2ODATA (moc_id,id,DocID,OriginalSalesOrderNumber,ChapterID,ChapterNumber,BookingType,Qty,ProductNumber,ProductDescription,NetPrice,LineItem,SalesOrderNumber,POMODCreatedDate,POMODCompletedDate) values('V4C20120228084130HP53','201560','208427','6301123146','140944','001000','Product Cancellation','2','M1943AL','Sp02 8-pin D-sub Adapter cable 3m (8pin)','-225.68','','','2012-05-21 10:18:06.67','2012-06-18 09:54:53.45')

I want to remove parenteses in Product Description value of my insert query "Sp02 8-pin D-sub Adapter cable 3m (8pin)" because in access database it's not allowing to insert data with parenteses.Can anyone please help me in this topic ?
Posted 19-Nov-12 22:03pm
Edited 19-Nov-12 22:30pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Regex.Replace("This (is (a) (test.", "[()]", "");

you can use it, for more you can see this.
nikhil _singh 20-Nov-12 4:42am
it's removing all the parentheses i want to remove only the inner one "(8pin)" if i remove the outer one i will get error.
@AmitGajjar 20-Nov-12 5:02am
all the time you have this single query ?
or you may have different query ?
nikhil _singh 20-Nov-12 5:20am
same single query.
@AmitGajjar 20-Nov-12 5:22am
then use this : Regex.Replace("This (is (a) (test.", "[(8pin)]", "");
@AmitGajjar 20-Nov-12 5:22am
let me know if it works?
nikhil _singh 20-Nov-12 5:28am
the loop will run for many other attributes like "<Scripts>"(as I posted on this XML)so that time it will create problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100