[Mono-list] aspsqlprovider problem select table users

Rodrigo Cuevas bellinux at gmail.com
Tue Mar 17 15:36:11 EDT 2009


Hi Francisco, thank.

Other code with problem:

MembershipUser user = Membership.GetUser("testuser"); //ok
string pass = user.GetPassword(); //error

Error:

Unable to cast object of type 'System.DBNull' to type 'System.String'.

D:\Sigem7\src\Npgsql2.0.4.src\src\Npgsql\NpgsqlDataReader.cs    Line: 306
public override String GetString(Int32 i)
Line 305:        {
Line 306:            return (String) GetValue(i); //error
Line 307:        }

Stack Trace:

[InvalidCastException: Unable to cast object of type 'System.DBNull' to 
type 'System.String'.]
   Npgsql.NpgsqlDataReader.GetString(Int32 i) in 
D:\Sigem7\src\Npgsql2.0.4.src\src\Npgsql\NpgsqlDataReader.cs:306
   NauckIT.PostgreSQLProvider.PgMembershipProvider.GetPassword(String 
username, String answer) in 
D:\Sigem7\src\NauckIT.PostgreSQLProvider-1.2.4.0\PgMembershipProvider.cs:782

Error Npgsql 2.0.4 or  not ?

Rodrigo Cuevas.


Francisco Figueiredo Jr. escribió:
> On Sat, Mar 14, 2009 at 18:11, Rodrigo Cuevas <bellinux at gmail.com> wrote:
>   
>> Hi,
>>
>> The problem is in the method GetParseCommandText() in file NpgsqlCommand.cs
>>
>> Comment lines:
>>
>> if (parameters[i].TypeInfo.UseSize && (parameters[i].Size > 0))
>> {
>>   parseCommand += string.Format("({0})", parameters[i].Size);
>> }
>>
>> Now work.
>>
>> It is a bug in Npgsql 2.0.4 or not?
>>
>>     
>
> Hi, Rodrigo!
>
> It seems to be a bug in Npgsql indeed.
> We received today a report about it:
>
> http://pgfoundry.org/forum/message.php?msg_id=1004741
>
> I'll be working to get a testcase for this and apply the fix so we
> don't get this problem again in future releases.
>
> Thank you and Daniel for your feedback on this.
>
>
>
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bellinux.vcf
Type: text/x-vcard
Size: 186 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20090317/b5f723aa/attachment.vcf 


More information about the Mono-list mailing list