if (yourquery.Trim().ToUpper().StartsWith("SELECT")) { // execute the query }
if(yourString.ToUpper().Contains("SELECT") && !yourString.ToUpper().Contains("UPDATE")) { execute the query .... }
string ss = "select * from tablename"; int c = ss.IndexOf("select"); if(c>=0) { ..executeablecode } else { return; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)