how to write a code for sql parser to parse select statements in c#.

I pulled it off of another site hope it helps you...

using System.Data.EntityClient; 
... 
EntityConnection conn = new EntityConnection(myContext.Connection.ConnectionString); 
conn.Open(); 
EntityCommand cmd = conn.CreateCommand(); 
cmd.CommandText = @"Select t.MyValue From MyEntities.MyTable As t"; 
var queryExpression = cmd.Expression; 
.... 
conn.Close();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.