Data FAQ
How to get SQL to LINQ verbose logging
How can I see what SQL quries get executed when I write my own LINQ quries in C# using the C1 Data API?
Answer:
This requires that your site is already running on SQL.
- Edit your ~/App_Data/Composite/Composite.config
- Locate the following XML elements:
<Composite.Data.Plugins.DataProviderConfiguration defaultDynamicTypeDataProviderName="DynamicSqlDataProvider"> <DataProviderPlugins> <add name="DynamicSqlDataProvider" connectionString="YOUR CONNECTION STRING" sqlQueryLoggingEnabled="false" sqlQueryLoggingIncludeStack="false" type="Composite.Plugins.Data.DataProviders.MSSqlServerDataProvider.SqlDataProvider, Composite" /> <!-- More elements here, but not needed in this FAQ --> </DataProviderPlugins> </Composite.Data.Plugins.DataProviderConfiguration>
- Change the attribute 'sqlQueryLoggingEnabled' to 'true'.
- Optionally add the following:
<Composite.Data.Plugins.DataProviderConfiguration defaultDynamicTypeDataProviderName="DynamicSqlDataProvider"> <DataProviderPlugins> <add name="DynamicSqlDataProvider" connectionString="YOUR CONNECTION STRING" sqlQueryLoggingEnabled="true" sqlQueryLoggingIncludeStack="false" type="Composite.Plugins.Data.DataProviders.MSSqlServerDataProvider.SqlDataProvider, Composite"> <LoggingIgnoreInterfaces> <add interfaceType="Composite.Data.Types.IUserConsoleInformation" /> </LoggingIgnoreInterfaces> </add> <!-- More elements here, but not needed in this FAQ --> </DataProviderPlugins> </Composite.Data.Plugins.DataProviderConfiguration>