|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Create database with embedded version in .NET
Hello all,
I am just starting to look at Firebird and I want to use the embedded version in .NET. My question is how do I create a database to start with. Is there some command in the .NET provider to do this? It didn't look like any utilities are included with the embedded version. Any help will be appreciated. Thanks Jay |
|
#2
|
|||
|
|||
|
Hi
Embedded refers to the driver being embedded into your application. The Database is still external. To create a Database you need to type DDL statements (like Create Database Bla bla bla...) into the ISQL command window that is suppled with Firebird - look in Bin Dir. You should be able to pass DDL statements through the provider as it is almost like normal SQL - but i am not to sure that you can create databases with it, as the provider connects to an existing database. For an easier approuch try usinging a tool like IBAdmin or IBExpert. IBExpert has a personal edition that you can download for free. When looking for Firebird tools remember to include Interbase in your search. |
|
#3
|
|||
|
|||
|
Thanks
WayneB,
Thanks for the reply. I had tried using ISQL and GSEC and I just kept on getting an errors about "unavailable database" and "unable to open database". In ISQL I was getting -904 when I tried to create the database. I finally downloaded firebird on another box and gsec and isql worked fine there. It ended up that I uninstalled MSDE and then it all started to work fine. I even re-installed MSDE and gsec and isql are still running fine. I have no idea why it was having a problem but it seems great now. I managed to create my database and I was able to access it via .NET and the embedded engine. Looks like I asked a question just a little to quick. Thanks again for the reply. Jay |
|
#4
|
|||
|
|||
|
Quote:
Review FbConnection.CreateDatabase method. |
|
#5
|
|||
|
|||
|
I did get it to work with the .CreateDatabase method. I was getting hung up on what to pass in the hash table. So I just downloaded the source and looked up the CreateDatabase method implementation to see what to pass. Once I had that, it worked perfect.
Thanks Again Jay |
|
#6
|
|||
|
|||
|
Quote:
Jaybirdbsu, could you please post a code example? |
|
#7
|
|||
|
|||
|
Quote:
Hi there, if you want to create the database within your app take a look at this example. Code:
...
using FirebirdSql.Data.Firebird;
...
string dbFile = AppDomain.CurrentDomain.BaseDirectory + "data/coats.gdb";
Hashtable creationParametes = new Hashtable();
creationParametes.Add("ServerType", "1");
creationParametes.Add("User", "coatsUser");
creationParametes.Add("Password", "coatsUser.x");
creationParametes.Add("Database", dbFile);
FbConnection.CreateDatabase( creationParametes );
|
|
#8
|
|||
|
|||
|
You can see also this example of creating a Firebird database.
|
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Create database with embedded version in .NET |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|