Calling StoreProcedure

Posts   
 
    
Rishi
User
Posts: 69
Joined: 31-Oct-2011
# Posted on: 10-Nov-2011 23:46:30   

Hi,

I am trying to call store procedure and getting exception "The ConnectionString property has not been initialized." I don't have any idea where should i provide connection string? Can you guide me on this..

Dim responseDataTable As System.Data.DataTable = _ RetrievalProcedures.GetEmployee(1)

Also, I would like to bind datatable to corresponding Entity, I was not able find any better approach to do that. Can you tell me how i can achieve this.

Thanks in advance...

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 11-Nov-2011 05:44:05   

Rishi wrote:

I am trying to call store procedure and getting exception "The ConnectionString property has not been initialized." I don't have any idea where should i provide connection string?

You have to specify your connection string in the *.config file of your application.

<configuration>
    <appSettings>
        <add key="Main.ConnectionString" value="data source=..."/>
        ...
    </appSettings>
</configuration>

When you generate code from LLBLGen an app.config is included to your DBSpecific project for adapter and the only generated project for SelfServicing as an example.

Rishi wrote:

Also, I would like to bind datatable to corresponding Entity, I was not able find any better approach to do that. Can you tell me how i can achieve this.

For one entity, just fill the new entity with the values of the dataTable. If you are fetching a list of records you can use Projections.

David Elizondo | LLBLGen Support Team