xslt extension dll for querying databases Options
astuanax
Posted: Wednesday, August 09, 2006 10:46:16 AM

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.txt
dll: http://blockquote.be/examples/dll-astuanax.zip">dll
vs2003 project: http://blockquote.be/examples/astuanax.zip

Let me know what you think/Len.
daniel
Posted: Friday, August 11, 2006 8:46:58 PM

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

Ig_p118
Posted: Saturday, August 12, 2006 10:43:24 AM
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
Hagge
Posted: Sunday, August 13, 2006 12:55:09 PM
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!
daniel
Posted: Sunday, August 13, 2006 4:06:04 PM

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
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.