I have an SQL string
select Id, Name from Order where Id ='8675' and Name ='Test'
How can I get the parts of this using C#, i.e. the from
part, where
part and select
part to end up with:
select Id, Name
-----> select partfrom Order
-----> from partwhere Id ='8675'
-----> where part
and any other part if required, if they have group by
etc?
I have tried the following
var str = @"select Id, Name from Order where Id ='8675' and Name ='Test'";
String[] spearator = { "from", "where" };
String[] strlist = str.Split(spearator,
StringSplitOptions.RemoveEmptyEntries);
The issue i get now is that it doesnt ignore case , so if there was a From it wont work . How can i do that ?