This is a migrated thread and some comments may be shown as answers.

How to set initSql of BackendConfiguration in code?

1 Answer 55 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Richard Koslik
Top achievements
Rank 1
Richard Koslik asked on 12 Oct 2010, 02:21 PM
Hello,

how can i set the initial sql command after the db connection in the code.

I want to do it somewhere here...
protected override MyDomainContext CreateDataContext()
{
    XmlMetadataSource metadataSource = XmlMetadataSource.FromAssemblyResource("MyTables.rlinq");
    string connectionString = string.Empty;
    BackendConfiguration dbConfig = new BackendConfiguration();
  
    dbConfig.initSql = ?????????????           
.
.
.
  
    return new MyDomainContext(connectionString, dbConfig, metadataSource);
}

But i can't find the property to store the sql command.
Where can it be done in code?

Thanks,
Richard.

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 15 Oct 2010, 06:32 PM
Hi Richard Koslik,

 The API in the BackendConfiguration settings are is split in few categories for more clear usage like: Runtime, Logging, ConnectionPool etc.
The InitSQL setting is under the ConnectionPool settings so the code you should be using is the following:

dbConfig.ConnectionPool.InitSQL.Add("Sample Statement");

This way you are able to specify more than one initSQL statement for your connections.


Greetings,
Zoran
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Databases and Data Types
Asked by
Richard Koslik
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or