Developer forum

Forum » CMS - Standard features » How to access the database in DW8 (run queries, select data, so on..)

How to access the database in DW8 (run queries, select data, so on..)

Peter Gustafsson
Reply
There are a couple of threads on this, but they seem to be about older versions. Many of the functions in the Dynamicweb.Database class that they are using no longer exist (.GetConn, .GetDataReader, etc.)
Is there a document or example somewhere of how to acess the database in the latest version of dynamic web?

Replies

 
Lars Britz
Reply
You are able to run simple queries in SQL Firehose, which you can access through the Management Center > Database > SQL Firehose. 
 
Peter Gustafsson
Reply
I meant from the code. 
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Peter,
 

A quick way to learn more about this is by letting Dynamicweb generate some code for you (Management Center | Developer | Code Generation). The templates have been updated to match the new DW 8 API. From there, IntelliSense can help you find other methods on the Database class not used in the generated code.

Of course you're not limited to Dynamicweb's database access layer. You could just as well use Entity Framework, another ORM or plain ADO.NET to access the database.

Hope this helps,

Imar
 

 

You must be logged in to post in the forum