How can I run a SQL statement form LLBL

Posts   
 
    
yoyo
User
Posts: 4
Joined: 25-Jul-2005
# Posted on: 27-Jul-2005 17:18:59   

Hi, How can I run my own SQL Statement from LLBL? Please can somebody send me examples.

thanks Yoyo

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 27-Jul-2005 18:52:01   

Selfservicing or adapter?

Frans Bouma | Lead developer LLBLGen Pro
yoyo
User
Posts: 4
Joined: 25-Jul-2005
# Posted on: 28-Jul-2005 22:04:41   

Can You send me some code sample. Thank you for your help

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 28-Jul-2005 23:08:13   

Otis wrote:

Selfservicing or adapter?

Yea, I'm a smart alec wink

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 28-Jul-2005 23:18:57   

yoyo wrote:

Can You send me some code sample. Thank you for your help

Please tell me what you're using: selfservicing or adapter. It depends on that how to get it working.

Frans Bouma | Lead developer LLBLGen Pro
yoyo
User
Posts: 4
Joined: 25-Jul-2005
# Posted on: 29-Jul-2005 15:31:47   

Sorry for this basic questions! This is my first time using LLBL. I am using adapter

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 29-Jul-2005 17:08:59   

yoyo wrote:

Sorry for this basic questions! This is my first time using LLBL. I am using adapter

Ok, if it's your first time, are you sure you want to execute a raw SQL statement, or that you want to run a query using predicates? What's the query you want to run exactly?

Using adapter, you can obtain a connection by using a derived class from DataAccessAdapter and in there place your method which will execute the raw SQL. Then create a new physical connection object by using base.CreateNewPhysicalConnection(), and write normal ADO.NET code using that connection.

Though if you want to do something else, please be more specific. I have the feeling you want to know how to fetch data/update data for example, as it's not recommended to execute raw sql via the framework.

Frans Bouma | Lead developer LLBLGen Pro