Friday, February 17, 2012

Custom Assemblies: Using same data source as in RS

Hi all,
most of all works like charm, but I'm thinking how to define database
data source for my custom assembly. The best option would be use same
datasource as is defined in RS, it should be in some way shared ?
Now I have defined it like:
connSql = New
SqlConnection("server=localhost;uid=foo;pwd=bar;database=MYDB")
It would be nice, if I change Data Source in RS, it will change also
in my assembly, but I'm not sure if it is possible. Also, next option
which comes to my mind is read CFG from external file...
Thanks for any idea
/branoBrano,
Are you implementing IDbConnection, IDbConnectionExtension? If you
are, you'll get all the datasource connection information, including
the User/PW defined in the report datasource.
I then have a constructor on my Command implementation that looks like
this:
public DsCommand(string aCmdText, DsConnectionWrapper aConnection)
{
mCommandText = aCmdText;
mConnection = aConnection;
}
I grab any pertinent Connection information I need down the road.
Andy Potter|||Hello Potter,
Wednesday, January 25, 2006, 2:30:37 PM, you wrote:
> Are you implementing IDbConnection, IDbConnectionExtension? If you
> are, you'll get all the datasource connection information, including
> the User/PW defined in the report datasource.
Thats good, I exatly need to do this. I dont know what is
IDbConnection.
> I then have a constructor on my Command implementation that looks like
> this:
> public DsCommand(string aCmdText, DsConnectionWrapper aConnection)
> {
> mCommandText = aCmdText;
> mConnection = aConnection;
> }
> I grab any pertinent Connection information I need down the road.
should you please send me some code with examples, or where I should
read about this ? I am really new to VB .NET (you are using C# as I
see, but thats nearly same now) and need more help.
Really thanks, good news is it is possible :)|||Look at Teo Lacehv's sample (do a google search). He implements the
IDbConnection and should give you a better idea of all the interfaces
you need to implement.
Andy Potter|||Hello Potter,
> Look at Teo Lacehv's sample (do a google search). He implements the
> IDbConnection and should give you a better idea of all the interfaces
> you need to implement.
Thanks, sure I will.

No comments:

Post a Comment