|
|
SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Last post 07-04-2008, 8:17 AM by wrawson. 24 replies.
-
06-11-2008, 5:44 PM |
-
wrawson
-
-
-
Joined on 02-10-2008
-
Wellsboro PA
-
Posts 42
-
-
|
SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Sorry if this is the wrong forum topic to be posting this but I did not find anything when searching the forums.
It seems the Code Generation for ES 2008 does not function for timestamps and or rowversion fields in a SQL Ce 3.5 Database the code generated says these fields are of type unknown when they are binary fields so of course none of the entities or objects work for these type of fields and I had to remove them from the Database to even get the generated code to compile. I use these type of fields for syncing Data between Sql Server and local SQL Ce database. There is a rowversion type of field in SQL Ce that is a timestamp format actually it is a uniqe identifier and auto updates with every update to the record without need to do this in code. Very similar to Timestamp Type of field in SQL Server. This needs to be in ES 2008. ES 2008 already can handle the type of field (binary, rowversion) if the Code Generation provided the proper type. I tried adding the mappings in mygeneration and it does not work. So I am using MyGeneration ES 2008 beta 4 and VS 2008 with SQL Ce 3.5
|
|
-
06-11-2008, 6:03 PM |
-
Mike.Griffin
-
-
-
Joined on 01-14-2007
-
Indianapolis
-
Posts 3,055
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Darn wrawson, I was really hoping for a good report from you. But I'm confused. EntitySpaces no longer uses the MyGeneration mapping files, we have our own, it's in a file named "esLanguages.xml", here are the mappings that should be in your copy in your MyGeneration\Settings folder.
Code: <Language From="SQLCE" To="C#"> <Type From="bigint" To="long" /> <Type From="binary" To="object" /> <Type From="bit" To="bool" /> <Type From="char" To="string" /> <Type From="datetime" To="DateTime" /> <Type From="decimal" To="decimal" /> <Type From="float" To="double" /> <Type From="image" To="byte[]" /> <Type From="int" To="int" /> <Type From="money" To="decimal" /> <Type From="nchar" To="string" /> <Type From="ntext" To="string" /> <Type From="numeric" To="decimal" /> <Type From="nvarchar" To="string" /> <Type From="real" To="float" /> <Type From="smalldatetime" To="DateTime" /> <Type From="smallint" To="short" /> <Type From="smallmoney" To="decimal" /> <Type From="text" To="string" /> <Type From="timestamp" To="byte[]" /> <Type From="tinyint" To="byte" /> <Type From="uniqueidentifier" To="Guid" /> <Type From="varbinary" To="byte[]" /> <Type From="varchar" To="string" /> <Type From="xml" To="string" /> <Type From="sql_variant" To="object" /> </Language>
See what the DataTypeName is for the column in question is by using both the MyMeta Browser and MyMeta Properties windows. Just click on the column and it should list the type, if it's not in the esLanguages.xml add it and see if it works, we'll add it to the final release, you should definitely be able to use our Release Candidate if you're using an ES2008 Beta because we've lost no functionality on this that I know of.
EntitySpaces | Twitter | BLOG | Please honor our Software License
|
|
-
06-12-2008, 7:27 AM |
-
Mike.Griffin
-
-
-
Joined on 01-14-2007
-
Indianapolis
-
Posts 3,055
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Any luck, I know this can work for you and we want to make sure it does.
EntitySpaces | Twitter | BLOG | Please honor our Software License
|
|
-
06-16-2008, 7:43 PM |
-
wrawson
-
-
-
Joined on 02-10-2008
-
Wellsboro PA
-
Posts 42
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
The one thing I will say is that It is fantastic that the ES 2008 allows for and has Providers to work both SQLCE and SQL in the same Non compact Framework as well as the COmpact framework this is a real live saver. Great Job. I will try to change the Mapping in the file you listed and let you know. As I use a bunch of roversion and timestamps and of GUID and uniqueindentifier fields in both SQL and SQLCe DB for tombstoning, syncing, conflict control etc. So You guys have done great and I will try this out tonight and get back to you. Thanks.
|
|
-
06-16-2008, 8:09 PM |
-
wrawson
-
-
-
Joined on 02-10-2008
-
Wellsboro PA
-
Posts 42
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Thanks I was adding the mapping in the wrong place I did as you suggested and it worked perfectly I belief that it needs added in both places but that is niether here nor there I will test latwer on. But I was able to add my rowversion field and the generated code combiled great and ES treats the field (column) as a byte() and functions correctly. So thanks. I love ES 2008 I am geting ready to use the WCF Proxystub very soon. Again Great Job. And thanks. I will be soon using ES 2008 with both SQL Server and Local DB (SQLCe ) with silverlight 2.0 applications and I belief It will completly change the way I do Server client apps.
|
|
-
06-16-2008, 9:10 PM |
-
Mike.Griffin
-
-
-
Joined on 01-14-2007
-
Indianapolis
-
Posts 3,055
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Excellent, can you show us the mapping you added, we'll make sure it's in the final release.
EntitySpaces | Twitter | BLOG | Please honor our Software License
|
|
-
06-17-2008, 5:11 AM |
-
wrawson
-
-
-
Joined on 02-10-2008
-
Wellsboro PA
-
Posts 42
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Code: <Type From="rowversion" To="byte[]" />
|
|
-
06-17-2008, 5:18 AM |
-
wrawson
-
-
-
Joined on 02-10-2008
-
Wellsboro PA
-
Posts 42
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
But I am recieving some exceptions. The generated code compiles. But I recieve a exception of "{Udt}" during save. I will post some code in a little while. The exception is strange as that is the only description given. The Stack trace is:
Code: at System.Data.SqlServerCe.SqlCeType.FromSqlDbType(SqlDbType type) at System.Data.SqlServerCe.SqlCeParameter.set_SqlDbType(SqlDbType value) at System.Data.SqlServerCe.SqlCeParameter..ctor(String name, SqlDbType dataType, Int32 size, String sourceColumn) at EntitySpaces.SqlServerCeProvider.Cache.GetParameters(Guid dataID, esProviderSpecificMetadata providerMetadata, esColumnMetadataCollection columns) at EntitySpaces.SqlServerCeProvider.Cache.GetParameters(esDataRequest request) at EntitySpaces.SqlServerCeProvider.Shared.BuildDynamicInsertCommand(esDataRequest request, List`1 modifiedColumns) at EntitySpaces.SqlServerCeProvider.DataProvider.SaveDynamic(esDataRequest request) at EntitySpaces.SqlServerCeProvider.DataProvider.EntitySpaces.Interfaces.IDataProvider.esSaveDataTable(esDataRequest request) at EntitySpaces.Interfaces.esDataProvider.esSaveDataTable(esDataRequest request, esProviderSignature sig) at EntitySpaces.Core.esEntityCollection.SaveToProviderInsertsUpdates(esSqlAccessType sqlAccessType) at EntitySpaces.Core.esEntityCollection.SaveToProvider(esSqlAccessType sqlAccessType) at EntitySpaces.Core.esEntityCollection.Save(esSqlAccessType sqlAccessType) at EntitySpaces.Core.esEntityCollection.Save() at WindowsApplication1.Form1.TestingCollectionBindingNavigatorSaveItem_Click(Object sender, EventArgs e) in G:\WindowsApplication1\WindowsApplication1\Form1.vb:line 11 at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
|
|
-
06-17-2008, 6:14 AM |
-
Mike.Griffin
-
-
-
Joined on 01-14-2007
-
Indianapolis
-
Posts 3,055
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Is there any chance you can send your database to support@entityspaces.net, we're really getting down to the wire and need to make sure this work, this is very important to us. If you cannot send that database create a sample one with the same column type(s) in question.
Thanx
EntitySpaces | Twitter | BLOG | Please honor our Software License
|
|
-
06-17-2008, 10:54 AM |
-
wrawson
-
-
-
Joined on 02-10-2008
-
Wellsboro PA
-
Posts 42
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
I sent the db to the support email. Let me know if you got it.
Thanks,
wrawson
|
|
-
06-17-2008, 1:00 PM |
-
Mike.Griffin
-
-
-
Joined on 01-14-2007
-
Indianapolis
-
Posts 3,055
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
|
-
06-17-2008, 7:22 PM |
-
Mike.Griffin
-
-
-
Joined on 01-14-2007
-
Indianapolis
-
Posts 3,055
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Okay, I have generated successfully and it even brings the new "rowversion" AKA timestamp column back after an insert or update. The fixes are all rolled in. We might cut a quick RC2 before this weekend but not sure yet. Thanks so much, this was a huge help for us.
EntitySpaces | Twitter | BLOG | Please honor our Software License
|
|
-
06-17-2008, 7:53 PM |
-
wrawson
-
-
-
Joined on 02-10-2008
-
Wellsboro PA
-
Posts 42
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Great Job kudos This will make ES a very Strong contender for future apps wanting a smaller db footprint as well as central syncing with a central server. Thanks a million
|
|
-
07-03-2008, 11:26 AM |
-
wrawson
-
-
-
Joined on 02-10-2008
-
Wellsboro PA
-
Posts 42
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
Sorry to bug you guys agian. I am running into a problem with the Release of ES 2008 and SQL Ce. It appears that sometimes ES leaves the connection open to the Data File then throws an exception becuase it tries to open a new connection. The error is that is thrown is
The database file cannot be found. Check the path to the database. [ Data Source = Data\MIDCCe.sdf ]
But ES just opened and returned Data from that file in the same form. It is {System.Data.SqlServerCe} that can't access the file. Here is the Stack trace:
Code: at EntitySpaces.Core.esEntityCollection.SaveToProviderInsertsUpdates(esSqlAccessType sqlAccessType)
at EntitySpaces.Core.esEntityCollection.SaveToProvider(esSqlAccessType sqlAccessType)
at EntitySpaces.Core.esEntityCollection.Save(esSqlAccessType sqlAccessType)
at EntitySpaces.Core.esEntityCollection.Save()
at MobileIdCheck.UserControlAlert.FormScannedDataSaveScanResponses()
at MobileIdCheck.UserControlAlert.btnSaveOk_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at MobileIdCheck.UserControlUDC.btnSaveOk_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at MobileIdCheck.FormNewScan.FormScannedDataSaveScan()
at MobileIdCheck.FormNewScan.btnSaveOk_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at MobileIdCheck.FormMain.ScanItBaby()
at MobileIdCheck.FormMain.FakeSwipeToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at MobileIdCheck.My.MyApplication.Main(String[] Args)
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
|
|
-
07-03-2008, 11:29 AM |
-
wrawson
-
-
-
Joined on 02-10-2008
-
Wellsboro PA
-
Posts 42
-
-
|
Re: SQL Ce Entity Spaces provider and Code Generation to provide support for all Data Types for SQL Ce 3.5
So it appears that the Connection may be open and is not being reused. That is the same error you will receive if the DB is already open and locked.
Thanks
William
|
|
Page 1 of 2 (25 items)
1
|
|
|