Specifying the connection type.
I want to force the source data to be the same as my running app, so I intend to hide the add data soource window and set it up through code.
I've read the documentation and I know I can use the following to specify the connection string...
But how do I specify the connection type? (OleDb,MSAccess,XML,MSSQL, or even the plugin types, eg SQLlite, MySQL, and ODBC when you finish it?)
Thanks,
Anthony
I've read the documentation and I know I can use the following to specify the connection string...
private void report1_DatabaseLogin(object sender, DatabaseLoginEventArgs e)
{
  e.ConnectionString = my_connection_string;
}
But how do I specify the connection type? (OleDb,MSAccess,XML,MSSQL, or even the plugin types, eg SQLlite, MySQL, and ODBC when you finish it?)
Thanks,
Anthony
Comments
Config.DesignerSettings.ApplicationConnection
assign your application connection object (such as SqlConnection) to this property, and the report will use it when you invoke the "Data|Add Data Source..." menu. Note that not all connection types are supported, because FR replaces actual connection object with its own connector (for example, if you specify the SqlConnection, FR will use its own MsSqlDataConnection).
So I could do this?
ODBCConnection myCon;
myCon = ....
Config.DesignerSettings.ApplicationConnection= myCon;
Report myReport = new Report();
report.Design()
and it should be already set with my database?
If I do this, and then disable the "Add Data Source" menu item, then I can restrict the user to the database I choose, or must they use the "Add Data Source" to select the connection I passed? if so can I do this in code?
Will the ODBC support be built in (I think it should as it adds support for a lot of databases and only uses built in .net classes), or will it be a plugin?
if it's a plugin, will the passing an ODBCConnection work? and is it possible to ensure a plugin is loaded via code?
Sorry about all the questions I keep asking, hopefully there shouldn't be too many more [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> - Anthony[/img]
I'm going to make Odbc connection built-in.