DataContext::GetCommand Method
Provides information about SQL commands generated by LINQ to SQL.
Assembly: System.Data.Linq (in System.Data.Linq.dll)
Parameters
- query
- Type: System.Linq::IQueryable
The query whose SQL command information is to be retrieved.
This method is only a getter and does not affect DataContext state.
Note the following considerations:
The argument must be non-null. Otherwise, a null argument exception is thrown.
Normal query translation exceptions thrown during LINQ to SQL query execution apply for a query that cannot be translated.
Only the first query command is returned. Specifically, additional commands that are used for eager loading (LoadWith) are not included.
DataContext does not track what the user does with the command. For example, results from the execution of the returned command are not tracked and do not affect DataContext state.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.