Click here to Skip to main content
15,908,909 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello frens,
i have this simple question.

i have a sql query with multiple where keys. its like a query having multiple joins but what my task is to find the statement with the last 'where' clause. Please help asap and thanks in advance.

i m doing like this but wont work.

whereClause = sqlString.Substring(iWhere, iOrderBy - iWhere);

help with similar code

thanks happy coding
Posted
Updated 11-Feb-13 1:33am
v2
Comments
Sergey Alexandrovich Kryukov 11-Feb-13 2:03am    
The idea of "parsing through the SQL" would totally defeat the purpose of SQL, so...
—SA

Try a product like : http://www.sqlparser.com/[^]
 
Share this answer
 
You should look at String.LastIndexOf() method for such a thing. Here is a the MSDN[^] link.

Good luck,
OI
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900