Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Simple example on how to connect to a local database
Fri, Oct 12 2012 1:20 PMPermanent Link

Torben Laursen

Hi,

I am using elevateddb using ,NET and C#. Where can I find a simpel example on how I connect to a local database in a folder, lets say: c:\database?

I found these examples. But they dont state how to connect to a local database using the code
http://www.elevatesoft.com/articles?action=view&category=edb&article=elevatedb_20_net_data_provider_tips_tricks

Regards Torben
Fri, Oct 12 2012 1:29 PMPermanent Link

Raul

Team Elevate Team Elevate

Torben,

Do you already have the database?

Assuming you don't the the SQL manual getting started shows how to setup
a sample database

http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=Creating_Local_Database

and then DAC manual has all the info on the actual .net data provider

http://www.elevatesoft.com/manual?action=contents&id=edb2dac

and specifically

http://www.elevatesoft.com/manual?action=topics&id=edb2dac&section=using_the_net_data_provider

Essentially it comes down to specifying the appropriate connection
string (type local, configpath and database names etc).

You should be able to access it also using server explorer in vs.

Raul


On 10/12/2012 1:20 PM, Torben Laursen wrote:
> Hi,
>
> I am using elevateddb using ,NET and C#. Where can I find a simpel example on how I connect to a local database in a folder, lets say: c:\database?
>
> I found these examples. But they dont state how to connect to a local database using the code
> http://www.elevatesoft.com/articles?action=view&category=edb&article=elevatedb_20_net_data_provider_tips_tricks
>
> Regards Torben
>
Fri, Oct 12 2012 1:46 PMPermanent Link

Torben Laursen

Thanks,

I have the database.
And now I try to connect to it using just a few lines of code.
But it gives me this error:
"ElevateDB Error #100 There is an error in the metadata for the configuration EDBConfig (The encryption password does not match the default or current engine encryption password, which may be caused by the character set not matching the character set in use by the engine)"

What I have done is created a simle c# project. Added elevate.elevatedb.data.dll as reference and written this code
var build = new EDBConnectionStringBuilder();
     build.Database = "test_db";
     build.Type = "Local";
     build.ConfigPath = "C:\\test\\";
     build.UID = "customer";
     build.PWD = "x";

 EDBConnection DataConnection = new EDBConnection(build.ConnectionString);
     DataConnection.Open(); //Throws here

Regards Torben

Raul wrote:

Torben,

Do you already have the database?

Assuming you don't the the SQL manual getting started shows how to setup
a sample database

http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=Creating_Local_Database

and then DAC manual has all the info on the actual .net data provider

http://www.elevatesoft.com/manual?action=contents&id=edb2dac

and specifically

http://www.elevatesoft.com/manual?action=topics&id=edb2dac§ion=using_the_net_data_provider

Essentially it comes down to specifying the appropriate connection
string (type local, configpath and database names etc).

You should be able to access it also using server explorer in vs.

Raul


On 10/12/2012 1:20 PM, Torben Laursen wrote:
> Hi,
>
> I am using elevateddb using ,NET and C#. Where can I find a simpel example on how I connect to a local database in a folder, lets say: c:\database?
>
> I found these examples. But they dont state how to connect to a local database using the code
> http://www.elevatesoft.com/articles?action=view&category=edb&article=elevatedb_20_net_data_provider_tips_tricks
>
> Regards Torben
>
Fri, Oct 12 2012 2:19 PMPermanent Link

Torben Laursen

Torben Laursen wrote:

Problem solved. I deleted the settings file as stated here:
http://www.elevatesoft.com/supportfaq?action=view&category=edb&question=elevatedb_manager_encryption_password

And switch to the unicode version.

Regards
Torben
Fri, Oct 12 2012 2:24 PMPermanent Link

Raul

Team Elevate Team Elevate

Torben,

Is your database using a non-default encryption password? If so then you
need to specify it in the connection string (encryptpwd).

Likely not an issue but make sure your EDB database is unicode as the
..Net provider does not support EDB ANSI databases.

Raul



On 10/12/2012 1:46 PM, Torben Laursen wrote:
> Thanks,
>
> I have the database.
> And now I try to connect to it using just a few lines of code.
> But it gives me this error:
> "ElevateDB Error #100 There is an error in the metadata for the configuration EDBConfig (The encryption password does not match the default or current engine encryption password, which may be caused by the character set not matching the character set in use by the engine)"
>
> What I have done is created a simle c# project. Added elevate.elevatedb.data.dll as reference and written this code
>   var build = new EDBConnectionStringBuilder();
>        build.Database = "test_db";
>        build.Type = "Local";
>        build.ConfigPath = "C:\\test\\";
>        build.UID = "customer";
>        build.PWD = "x";
>
>    EDBConnection DataConnection = new EDBConnection(build.ConnectionString);
>        DataConnection.Open(); //Throws here
>
> Regards Torben
>
Image