Thanks for your response but it doesn't quite make sense.
Although obviously empty, the database is created without any error. Surely a permissions error to the file should resulted in an error during creation? Also, as the project folder resides within 'my documents', should there be any permission problem?
Also the error doesn't make sense: "Can't load file FesDatabase.cs under C:\Users\Jiri\Desktop\NETProvider\source\FirebirdSql\Data\Client\Native." There is no C:\Users\Jiri folder on my PC, this obviously relates to one of the developers Jiri??
Kind Regards, Wayne On 26/10/2011 17:29, SUMAN LAYEK wrote:
You are getting this error cause, you are trying to create your database in an unshared folder. You need to create Database in some public folder Like "Application Data". You can set the path in C# or Code like this way *Environment.SpecialFolder.ApplicationData*On Sun, Oct 23, 2011 at 4:01 PM, [email protected] <mailto:[email protected]> <[email protected] <mailto:[email protected]>> wrote:When I try and create a database, I get an error as follows: <quote> Can't load file FesDatabase.cs under C:\Users\Jiri\Desktop\NETProvider\source\FirebirdSql\Data\Client\Native. Check the file permission and the existence of that file. </quote> The fbembed.dll has been added to my project with the 'Copy to output directory' set to 'Always' My application is a simple console application using c# .Net 4.0 with code which follows: <code> using System; using FirebirdSql.Data.FirebirdClient; using FirebirdSql.Data.Isql; namespace Firebird_Test_1 { class Program { public static void Main(string[] args) { Console.WriteLine("Firebird Test 1!"); // TODO: Implement Functionality Here Console.WriteLine("Creating Databse..."); CreateDatabase(); Console.Write("Press any key to continue . . . "); Console.ReadKey(true); } static void CreateDatabase() { //specify the database name string dbName = "test.fdb"; //instanciate a new connection stringbuilder FbConnectionStringBuilder csb = new FbConnectionStringBuilder(); csb.Database = dbName; csb.UserID = "SYSDBA"; csb.Password = "masterkey"; csb.ServerType = FbServerType.Embedded; //embedded server //instanciate a connection object FbConnection con = new FbConnection(csb.ToString()); //check if the database exists if (System.IO.File.Exists(dbName) == false) //create the database as it didn’t exist FbConnection.CreateDatabase(csb.ToString()); //run the script against the current connection RunScript("Test.Sql", con); } static void RunScript(string ScriptName, FbConnection connection) { //get a reference to the executing assembly System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); //instanciate a textReader object initialised using a stream to the embedded resource System.IO.TextReader textReader = new System.IO.StreamReader(assembly.GetManifestResourceStream(ScriptName)); FbScript script = new FbScript(textReader.ReadToEnd().ToString()); //parse the script script.Parse(); //open the connection connection.Open(); FbBatchExecution fbe = new FbBatchExecution(connection); foreach (string cmd in script.Results) { //add each sql statement to the batch fbe.SqlStatements.Add(cmd); } //execute the batch fbe.Execute(); //close the connection connection.Close(); } } } </code> Can you please help? Kind Regards, Wayne ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ Firebird-net-provider mailing list [email protected] <mailto:[email protected]> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ Firebird-net-provider mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/firebird-net-provider No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 10.0.1411 / Virus Database: 2092/3973 - Release Date: 10/25/11
------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________ Firebird-net-provider mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
