当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Can't cast System.Collections.Generic.List into any valid DbType - Npgsql

问题描述:

I can update using Npgsql without a problem if i have int,double,string, but with List it is not working. For example:

com.Parameters.Add(new Npgsql.NpgsqlParameter("@number", number));

works without problem. number is an integer.

com.Parameters.Add(new Npgsql.NpgsqlParameter("@booking", BookingTest));

BookingTest is of type List< Booking>. I get the error message:

Can't cast System.Collections.Generic.List'1[Booking] into any valid DbType

How can i cast correctly?

分享给朋友:
您可能感兴趣的文章:
随机阅读: