|
|
 Rank: Devotee
Joined: 7/20/2006 Posts: 89
|
Hi everyone, I posted my xslt library. At the moment it is pretty basic, just 1 method: QueryDatabase(’connection string’,'query’) code: http://blockquote.be/examples/umbraco-xslt-lib-astuanax.txtdll: http://blockquote.be/examples/dll-astuanax.zip">dllvs2003 project: http://blockquote.be/examples/astuanax.zipLet me know what you think/Len.
|
|
 Rank: Aficionado
Joined: 7/19/2006 Posts: 190 Location: Norway
|
Hey
This could be quite usefull.
- but from a security point of view, the connectionStrings should probably be stored in web.config; <add key="northwind" value="Server=127.0.0.1;Database=northwind;User ID=northwind;Password=northwind;Trusted_Connection=False"/>
Then you could pass the key of the connection string you want to use, like;
<xsl:value-of select="MyNamespace.Library:QueryDatabase('northwind','select * from employees')" />
Just my toughts, Daniel
|
|
Rank: Fanatic
Joined: 7/21/2006 Posts: 255 Location: Salerno - Italy
|
How Can I using the same connection to umbraco DB? Red Consulting s.a.s - Umbraco from v1.0
|
|
Rank: Newbie
Joined: 7/27/2006 Posts: 10
|
I didn't look at you code. But if you would like to use the same connection string as Umbraco, you can use...
umbraco.GlobalSettings.DbDSN
to access the connection.
Regards, Hagge
Martin Hagermark - You just have to Love Umbraco!
|
|
 Rank: Aficionado
Joined: 7/19/2006 Posts: 190 Location: Norway
|
Hey
How about making that two methods, where the first takes one parameter - the sql query
The second takes two parameters - the sql query and the name of the connectionstring. This one uses the connectionString from umbraco.GlobalSettings.DbDSN (umbraco's connectionstring).
You can use the appSettings section in web.config to store connectionstrings and then grab them in your method using ConfigurationSettings.AppSettings(myConnStringPassedFromXslt)
Daniel
|
|
|
Guest |