Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7169437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:59:24+00:00 2026-05-28T14:59:24+00:00

I am engaged in an ETL project using IronPython and loading into a SQL

  • 0

I am engaged in an ETL project using IronPython and loading into a SQL Server database represented by an EDM 4.1 model provided to me. While I can generally load and save the data without trouble, I’m plagued by string length overruns in the incoming data. This throws an exception in the final .SaveChanges() call to the EDM. I receive no information in the exception about what entity, entity class, or property threw the error.

I would like to modify my code so that it checks the max length of the column for the database’s metadata at the time of assignment. It appears that this metadata is not available through the entity class but rather using the MetadataWorkspace of the EDM context object.

In order to call .GetItems() on the MetadataWorkspace, I need to provide an enumeration value from System.Data.Metadata.Edm.Dataspace:

 .GetItems(System.Data.Metadata.Edm.Dataspace.CSpace)

Unfortunately, I don’t seem to be able to reference System.Data.Metadata in any way. I cannot get beyond System.Data:

 >>> import clr
 >>> clr.AddReference("System.Data")
 >>> import System.Data
 >>> clr.AddReference("System.Data.Metadata")
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 IOError: System.IO.IOException: Could not add reference to assembly System.Data.Metadata
    at IronPython.Runtime.ClrModule.AddReference(CodeContext context, String name)

Does anyone have experience in introspecting EDM metadata from IronPython?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:59:25+00:00Added an answer on May 28, 2026 at 2:59 pm

    To be able to access MetadataWorkspace you need to add reference to System.Data.Entity.dll (if you don’t have one) and then drop down to ObjectContext like this:

    ((IObjectContextAdapter)ctx).ObjectContext.MetadataWorkspace
    

    where ctx is your DbContext derived class.
    Also in EF 4.1 there is a Validation feature implemented. I am not sure if this what throws the exception because it should give you all the details – including property name and a reference to the entity where the validation error occured. If the exception is thrown by the database it would mean that Validation is turned off. If you turned it on it would check facets and throw an execption if they are validated. Here are the links to blog posts on Validation:

    http://blogs.msdn.com/b/adonet/archive/2011/05/27/ef-4-1-validation.aspx
    http://blogs.msdn.com/b/adonet/archive/2010/12/15/ef-feature-ctp5-validation.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm engaged in writing a product using LinqToSql for data-access. While we're rapidly developing,
in my spare time I'm engaged with writing a little game using Microsofts XNA
I'm engaged in developing a turn-based casual MMORPG game server. The low level engine(NOT
I am engaged in a small debate with the server side developer for my
How can plural nouns be converted into singular nouns using R? I use the
I'm engaged in a project with a customer that requires MOSS to be installed
I have a column in my sql server 2005 table that should hold the
I'm involved with a project using DotNetNuke version 05.01.04 Community Edition . We are
I've recently engaged on studying WPF (to be honest, I've gotten into it just
I am working under Ubuntu 11.04 and now engaged in a project whose source

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.