I have tried to install the linq visualizer debugger, but it doesn’t seems to work.
I have tried to find the .Log property and the .GetCommand() methods of the context, but I can’t find which of my objects is the context.
public static DATAGESTIONDataSet FillDataSet_Tb_Activite()
{
var cn = new OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ImportSerce.Properties.Settings.DATAGESTIONConnectionString"].ToString());
var cmd = new OleDbCommand("SELECT * FROM [Tb_Activite]", cn);
var da = new OleDbDataAdapter(cmd);
var tds = new data.DATAGESTIONDataSet(); // the DATAGESTIONDataSet() is a xsd file, modeled after a MS Access database
da.Fill(tds, tds.Tb_Activite.TableName);
cn.Close();
cn.Dispose();
return tds;
}
And in the Main() method :
var dsActivites = FillDataSet_Tb_Activite();
var activitesSoc = from s in dsActivites.Tb_Activite
where s.Code.ToLower().StartsWith("w")
select s.Ident;
On which of my objects should I find the Log property or the GetCommand methods ?
Thanks
logis on theDataContext.http://msdn.microsoft.com/en-us/library/bb386961.aspx
You could also run your Linq to Sql code in linqpad to view the generated SQL.
Or use SQL Profiler to see what SQL is run against your database.
Update
However, in this case you are not generating any SQL with Linq. You are using straight
ADO.Netto fill your dataset.SELECT * FROM [Tb_Activite]is returning the entire table, thereafter you are using linq to objects or linq to datasets to query the local in-memory data. That’s why you can’t find theDataContext– you don’t have one.