ALinq for Oracle(V2.2) 日期 映射的一个 BUG(已修正)
2010-02-24 16:58 麦舒 阅读(414) 评论(0) 编辑 收藏 举报看到有朋友在搜索引擎上这个问题。故将这封邮件帖出来。其实碰到一些莫明其妙的问题,最好的办法是给我发电子邮件。
The Oracle Provider don't recognize the Date type of Oracle database, please set the DbType of Column Mapping as DateTime, just like below
[Column(Storage="_ShippedDate", UpdateCheck=UpdateCheck.Never, DbType="DateTime")]
public System.Nullable<System.DateTime> ShippedDate
{
public System.Nullable<System.DateTime> ShippedDate
{
get;set;
}
Or do not special the DbType, just like below
[Column(Storage="_ShippedDate", UpdateCheck=UpdateCheck.Never]
public System.Nullable<System.DateTime> ShippedDate
{
public System.Nullable<System.DateTime> ShippedDate
{
get;set;
}
It's a bug, but I have fixed it, i will send you the new version after a few hours.
regard
Shu Mai
------------------ Original ------------------
Date: Tue, Feb 23, 2010 06:31 AM
To: "ansiboy"<ansiboy@163.com >;
Subject: exception w/ Alinq (oracle db) - pls help!
Hi! Thanks for releasing ALinq.
I'm having a problem inserting a row into an Oracle table. I get the following exception on ..SubmitChanges();.
The specified type 'DATE' is not a valid provider type.
at ALinq.Oracle.OracleDataTypeProvider.a(String A_0, Int32 A_1, Int32 A_2, String[] A_3)
at ALinq.Oracle.OracleDataTypeProvider.b(String A_0)
at ALinq.SqlClient.dn.d(String A_0)
at ALinq.SqlClient.ag.a(MetaDataMember A_0)
at ALinq.SqlClient.ag.a(a3 A_0, MemberInfo A_1)
at ALinq.Oracle.i.a(Expression A_0, LambdaExpression A_1)
at ALinq.SqlClient.b8.e(MethodCallExpression A_0)
at ALinq.SqlClient.b8.a(MethodCallExpression A_0)
at ALinq.Oracle.i.a(MethodCallExpression A_0)
at ALinq.SqlClient.b8.k(Expression A_0)
at ALinq.SqlClient.b8.i(Expression A_0)
at ALinq.SqlClient.SqlProvider.BuildQuery(Expression query, ce annotations)
at ALinq.SqlClient.SqlProvider.Execute(Expression query)
at ALinq.aa.a.b(c A_0)
at ALinq.aa.a.c(c A_0)
at ALinq.y.a(ConflictMode A_0)
at ALinq.DataContext.SubmitChanges(ConflictMode failureMode)
at ALinq.DataContext.SubmitChanges()
at SANArchive.Program.Main(String[] args) in D:\Profiles\SAN\SANArchive\SANArchive\Program.cs:line 208
at ALinq.Oracle.OracleDataTypeProvider.b(String A_0)
at ALinq.SqlClient.dn.d(String A_0)
at ALinq.SqlClient.ag.a(MetaDataMember A_0)
at ALinq.SqlClient.ag.a(a3 A_0, MemberInfo A_1)
at ALinq.Oracle.i.a(Expression A_0, LambdaExpression A_1)
at ALinq.SqlClient.b8.e(MethodCallExpression A_0)
at ALinq.SqlClient.b8.a(MethodCallExpression A_0)
at ALinq.Oracle.i.a(MethodCallExpression A_0)
at ALinq.SqlClient.b8.k(Expression A_0)
at ALinq.SqlClient.b8.i(Expression A_0)
at ALinq.SqlClient.SqlProvider.BuildQuery(Expression query, ce annotations)
at ALinq.SqlClient.SqlProvider.Execute(Expression query)
at ALinq.aa.a.b(c A_0)
at ALinq.aa.a.c(c A_0)
at ALinq.y.a(ConflictMode A_0)
at ALinq.DataContext.SubmitChanges(ConflictMode failureMode)
at ALinq.DataContext.SubmitChanges()
at SANArchive.Program.Main(String[] args) in D:\Profiles\SAN\SANArchive\SANArchive\Program.cs:line 208
The oracle table has several data fields of type "Date".
Any ideas?
Thanks for your help!