From: olegmad <ol...@ya...> - 2003-10-18 11:51:06
|
Hello! I download firebird .net provider 1.5 beta 2 for .net framework 1.1. I try run that simple code: ---------------------------- FbConnection connection = new FbConnection(ConnectionString); connection.Open(); FbTransaction transaction = connection.BeginTransaction(); FbCommand command = new FbCommand("SELECT * FROM \"TTT\"", connection, transaction); DataTable table = new DataTable(); FbDataAdapter adapter = new FbDataAdapter(command); adapter.Fill(table); // EXCEPTION HERE !!!!! transaction.Commit(); connection.Close(); ---------------------------- And I catch that exception: --------------- An unhandled exception of type 'System.NullReferenceException' occurred in system.data.dll Additional information: Object reference not set to an instance of an object. ---------------- But! When i use old (beta 1) .net provider - all OK. What wrong??? Please help!!! Bye. |
From:
<car...@te...> - 2003-10-18 12:04:42
|
Hello: > But! When i use old (beta 1) .net provider - all OK. I have made some tests without problems, can you send to me the table structure ( for see if it's a problem with character sets that now are handled in different way ), and the stack trace of the exception, please. -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: olegmad <ol...@ya...> - 2003-10-18 13:49:11
|
> I have made some tests without problems, can you send to me the table > structure > ( for see if it's a problem with character sets that now are handled in > different way ), CREATE TABLE TTT ( "id" INTEGER NOT NULL, "name" VARCHAR(64) NOT NULL ); > and the stack trace of the exception, please. Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at FirebirdSql.Data.Firebird.Gds.GdsField.set_SqlSubType(Int32 value) at FirebirdSql.Data.Firebird.Gds.GdsStatement.parseTruncSqlInfo(Byte[] info, GdsRowDescription rowDesc, Int32 lastindex) at FirebirdSql.Data.Firebird.Gds.GdsStatement.parseSqlInfo(Byte[] info, Byte[] items) at FirebirdSql.Data.Firebird.Gds.GdsStatement.Prepare() at FirebirdSql.Data.Firebird.FbCommand.InternalPrepare() at FirebirdSql.Data.Firebird.FbCommand.ExecuteReader(CommandBehavior behavior) at FirebirdSql.Data.Firebird.FbCommand.System.Data.IDbCommand.ExecuteReader(Com mandBehavior behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at ConsoleApplication.MainClass.Main(String[] args) in c:\vss\consoleapplication3\class1.cs:line 27 Thanks. |
From:
<car...@te...> - 2003-10-19 07:19:25
|
Hello: Fixed in CVS ( seems to give only when database has no character set specified.) -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: olegmad <ol...@ya...> - 2003-10-20 07:31:41
|
> Fixed in CVS ( seems to give only when database has no character set > specified.) Hello. I download CVS, compiled it, but I still have this error... :( I use the same code and catch same exception. In Firebird 1.5 I use charset = UNICODE_FSS font characters set = ANSI_CHARSET Whats wrong??? Thanks... |
From:
<car...@te...> - 2003-10-20 08:47:21
|
Hello: > In Firebird 1.5 I use > charset = UNICODE_FSS This is the character set of the database and table fields ?? Can you send a sample of the connection string that are you using ?? > font characters set = ANSI_CHARSET Where you are using this ?? I have added some changes more to the CVS. -- Best regards Carlos Guzmán álvarez Vigo-Spain |
From: olegmad <ol...@ya...> - 2003-10-20 14:11:52
|
> This is the character set of the database and table fields ?? Can you > send a sample of the > connection string that are you using ?? I create new database with that params: SQL Dialect = 3 Charset = UNICODE_FSS Page Size = 4096 I create new table in this database: CREATE TABLE TTT ( "id" INTEGER NOT NULL, "name" VARCHAR(10) ); You can just compile and run next sample, without editing, all info in ConnectionString - workable! I send you all my sample: ------------------------------------------------------------------ using System; using System.Data; using System.Data.Common; using FirebirdSql.Data.Firebird; namespace ConsoleApplication { class MainClass { static private readonly string ConnectionString = @"Server=80.80.104.12;Database=c:\temp\carlos.gdb;Connection Lifetime=15;Dialect=3;User=carlos;Password=carlos;"; static void Main(string[] args) { FbConnection connection = new FbConnection(ConnectionString); connection.Open(); FbTransaction transaction = connection.BeginTransaction(); FbCommand command = new FbCommand("SELECT * FROM TTT", connection, transaction); DataTable table = new DataTable(); FbDataAdapter adapter = new FbDataAdapter(command); adapter.Fill(table); transaction.Commit(); connection.Close(); } } } ------------------------------------------------------------------ P.S. When I use fb.net 1.5 for 1.1 beta 1 - all works fine!!! Thanks! |
From:
<car...@te...> - 2003-10-20 15:53:59
|
Hello: Ok, fixed in CVS. > static private readonly string ConnectionString = > @"Server=80.80.104.12;Database=c:\temp\carlos.gdb;Connection > Lifetime=15;Dialect=3;User=carlos;Password=carlos;"; One question, with this connection string the .net provider will use UNICODE_FSS as character set only if this is the Default character set of .net framework ( for example for me the default is ISO8859_1 ), if you want the .net provider working with UNICODE_FSS ( UTF-8 ), that it's database character set ;) ,you need to add this to the connection string: Charset=UNICODE_FSS ( With this probably the beta 2 release will work ok ;) but in any case can be better for you to get a new copy of CVS sources ) -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: olegmad <ol...@ya...> - 2003-10-21 10:07:22
|
> you need to add > this to the connection string: > > Charset=UNICODE_FSS Thanks!!! Now it work!!! :-) Bye. |
From: George L. <fir...@wo...> - 2003-10-18 19:36:56
|
I also get the same error message, but I get it as soon as I try to = assign a connection string to the connection. |
From:
<car...@te...> - 2003-10-18 21:02:37
|
Hello: > I also get the same error message, but I get it as soon as I try to > assign a connection string to the connection. It's fixed in CVS. -- Best regards Carlos Guzmán Álvarez Vigo-Spain |