C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Data Library and Connections

rated by 0 users
This post has 4 Replies | 1 Follower

Top 500 Contributor
Posts 19
LimarOT Posted: Wed, Apr 22 2009 2:12 AM

HI

 

I have tried to download from a number of posts samples of how to change a data library connection string at 'runtime' but have had problems in getting them to compile in Vb .net 2008...

Can someone please give me a example of how to do this

Regards

Graham

 

Top 10 Contributor
Posts 1,644
Hi Graham,

Attached is a small sample that updates the connection string at runtime.
See the DataClass.SchemaDef1_CreateSchema() method.

Regards,

-Andrey
Top 500 Contributor
Posts 19
LimarOT replied on Wed, Apr 22 2009 7:49 PM

Thanks Andrey...

An unrelated 'problem' as a newbie to vb.net... how do I access a 'variable' set by the the loading project so I can change the connection string?

I have 2 projects, DataLibrary and Project1... the user selects if they want 'live' or 'test' database in project1 and we create a db connection  accordingly for use with non-data library related access ... how can I pass this 'connection string' to the Data library project after selection?

Regards

Graham

 

Top 10 Contributor
Posts 1,644
Hi Graham,

You may find a new version of the sample in the attachment.

Regards,

-Andrey
Top 500 Contributor
Posts 19
LimarOT replied on Thu, Apr 23 2009 8:24 AM

Hi Andrey

Many THANKS!!!

Regards

Graham

 

Page 1 of 1 (5 items) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.