A
AlexeyRusanov
Guest
I'm having the following issue with a null UniqueIdentifier: I'm using MS SQL 2008, Framework 3.5 SQL setup: create table Table1(Column1 uniqueidentifier) insert into Table1 values(null) C# code that fails: DbProviderFactory factory = DbProviderFactories.GetFactory("DDTek.SQLServer"); DbConnection connection = factory.CreateConnection(); connection.ConnectionString = @"Authentication Method=NTLM;Database Name=....;Host=...."; connection.Open(); var command = connection.CreateCommand(); command.CommandText = "select Column1 From Table1"; var reader = command.ExecuteReader(); reader.Read(); var value = reader.GetGuid(0); it fails on "reader.Read();" with the following error message: "Byte array for GUID must be exactly 16 bytes long.". If Column1 is not Null, then it works alright. Could you help me with this error, please? Thanks!
Continue reading...
Continue reading...