ASP.NET application gives error 2002 while using SQL Anywhere 11 Entity model

814 views
Skip to first unread message

raga16

unread,
Jun 3, 2009, 7:54:09 AM6/3/09
to SQL Anywhere Web Development
I am trying to test the ADO.NET entity model feature with SQL Anywhere
11.0.1 with EBF 2222. A simple web page with access to a SQL Anywhere
11 database throws up an exception:

Schema specified is not valid. Errors:
iAnywhere.Data.SQLAnywhere.StoreSchemaMapping.msl(3,4) : error 2002:
The EntityContainer 'SchemaInformation' for the conceptual model
specified as part of this MSL does not exist in MetadataWorkspace.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Data.MappingException: Schema specified is
not valid. Errors:
iAnywhere.Data.SQLAnywhere.StoreSchemaMapping.msl(3,4) : error 2002:
The EntityContainer 'SchemaInformation' for the conceptual model
specified as part of this MSL does not exist in MetadataWorkspace.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace
below.

Stack Trace:


[MappingException: Schema specified is not valid. Errors:
iAnywhere.Data.SQLAnywhere.StoreSchemaMapping.msl(3,4) : error 2002:
The EntityContainer 'SchemaInformation' for the conceptual model
specified as part of this MSL does not exist in MetadataWorkspace.]
System.Data.Mapping.StorageMappingItemCollection.Init
(EdmItemCollection edmCollection, StoreItemCollection storeCollection,
IEnumerable`1 xmlReaders, List`1 filePaths, Boolean throwOnError)
+3626277
System.Data.Metadata.Edm.StoreMetadataEntry.LoadStoreCollection
(EdmItemCollection edmItemCollection, MetadataArtifactLoader loader)
+272

System.Data.Metadata.Edm.StoreItemCollectionLoader.LoadItemCollection
(StoreMetadataEntry entry) +16
System.Data.Metadata.Edm.MetadataCache.LoadItemCollection
(IItemCollectionLoader`1 itemCollectionLoader, T entry) +123

System.Data.Metadata.Edm.MetadataCache.GetOrCreateStoreAndMappingItemCollections
(String cacheKey, MetadataArtifactLoader loader, EdmItemCollection
edmItemCollection, Object& entryToken) +172
System.Data.EntityClient.EntityConnection.LoadStoreItemCollections
(MetadataWorkspace workspace, DbConnection storeConnection,
DbProviderFactory factory, DbConnectionOptions connectionOptions,
EdmItemCollection edmItemCollection, MetadataArtifactLoader
artifactLoader) +137
System.Data.EntityClient.EntityConnection.GetMetadataWorkspace
(Boolean initializeAllCollections) +298
System.Data.EntityClient.EntityConnection.GetMetadataWorkspace() +9
System.Web.UI.WebControls.EntityDataSourceWrapperCollection..ctor
(ObjectContext context, EntitySet entitySet, EntityType
restrictedEntityType) +171
System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect
(DataSourceSelectArguments arguments, Creator qbConstructor) +280
System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect
(DataSourceSelectArguments arguments) +154
System.Web.UI.WebControls.BaseDataList.GetData() +38
System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean
useDataSource) +153
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e)
+54
System.Web.UI.WebControls.BaseDataList.DataBind() +55
System.Web.UI.WebControls.BaseDataList.EnsureDataBound() +60
System.Web.UI.WebControls.BaseDataList.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+842


Any help will welcome.

thanks in advance

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053;
ASP.NET Version:2.0.50727.3053

Adi Nicoara

unread,
Jun 8, 2009, 5:35:48 PM6/8/09
to SQL Anywhere Web Development
Hi,

Can you please provide any additional steps on how to reproduce this?

I tried to reproduce this by creating a simple web application that
uses the ADO.NET Entity Framework with the SQL Anywhere 11.0.1.2222
demo.db sample database as such:
1. Created an Entity Data Model object per the instructions here:
http://www.sybase.com/detail?id=1056609
2. I did not continue with that sample, as it was for windows
application. After adding the Entity Data Model object, I built the
solution, and continued with my own steps.
3. Added a GridView object to the Default.aspx page. I set the
DataSource to connect to an ADO.NET Entity Data Model, and selected
for the named connection, the object that I created. For the Entity
Set Name, I specified the Employees table, and selected everything.

I ran the project as is, and everything worked fine for me.

As a side note, I used the .Net Framework version 3.5 SP1. I believe
that ADO.NET Entity Framework support was added with that version as
per:
http://www.asp.net/downloads/3.5-SP1/default.aspx
I tried to change the framework version of the project to the one that
you referenced, but since there is no support, the project failed to
build.

Hope that helps,
Adi

Adi Nicoara

unread,
Jun 22, 2009, 2:47:16 PM6/22/09
to SQL Anywhere Web Development
Just as an update, I finally have been able to reproduce this problem.
This is specific to ASP.NET Web Site projects, and I sadly have tested
with a ASP.NET Web application project.
This problem has been reported to Sybase iAnywhere engineering.

As a workaround to the problem, you can change your connectionString
in your web.config file to something like this:
<add name="Entities" connectionString="metadata=C:\path
\ProjectName.msl|C:\path\ProjectName.ssdl|C:\path
\ProjectName.csdl;provider=iAnywhere.Data.SQLAnywhere;provider
connection string='DataSourceName=&quot;SQL Anywhere 11 Demo&quot;'"
providerName="System.Data.EntityClient"/>

The relevant change is with the

metadata=C:\path\ProjectName.msl|C:\path\ProjectName.ssdl|C:\path
\ProjectName.csdl

line, where you will have to use the full path to where you have those
xml files stored. The way you generate those files, is by using:

edmgen.exe /provider:iAnywhere.Data.SQLAnywhere /mode:FullGeneration /
project:ProjectName /connectionstring:DataSourceName="SQL Anywhere 11
Demo"

The edmgen tool comes with Visual Studio 2008. Run edmgen.exe -? for a
list of options. You should run this from a Visual Studio 2008 command
prompt in case it is not in your system path.

Hope that helps,
Adi
Reply all
Reply to author
Forward
0 new messages