简体   繁体   中英

Trouble with SQL CE and Linq

I'm trying to get my program to use a LocalDataCache. I'm using Linq.

if (tempVehicle.VehicleFinancialInfo[0].askingPrice != null)
{
    // do stuff
}

askingPrice is a (decimal?) because VehicleFinancialInfo is a linq entityset.

The above if test works on SQL Express but it crashes the app in SQL Compact Edition. It gives the error "Specified Cast is not valid". Does anyone know what's going on. I need the program to work with both express and compact edition. Be gentle, I'm a noob to SQL and Linq

糟糕,当LocalDataCache向导创建.sdf数据库时,它将日期时间列创建为nchar ...感谢StanR。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM