16,021,125 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by carlos.ma (Top 3 by date)
carlos.ma
11-Oct-12 12:30pm
View
Hi, I have tested your query and it's running ok, so I think that the problem may be the type of data that you are using for the columns or if the second table (product1) doesn't allow null values for the rest of the fields that are not being inserted. It could help if you specify the type of error you are getting from SQL.
carlos.ma
11-Oct-12 10:50am
View
Ok, no problem, I'll explain you what I did here. I think the key point is when the count var value is 2, if this happens then it means that our value has at least 2 special characters so there is no need to continue the search; that's why the code just trims the content of the value from the begin to the appearance of the second special character. The code uses lastIndexOf instead of indexOf because if the second special character was the same that the first one then it would trim the value from the begin to the apperance of the first special character; for instance let's say that our value was "myname//", then using indexOf the result would be "myname", but with lastIndexOf the result will be "myname/". I hope I've made a good explanation, however if you have any doubt or comment let me know and I'll check it.
carlos.ma
8-Oct-12 15:26pm
View
Could you share your code to see how you are trying to do that, please?