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

  • Home
  • SEARCH
  • 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 6671353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:22:43+00:00 2026-05-26T03:22:43+00:00

I have a complex type, with all string properties // Actual class is auto-generated

  • 0

I have a complex type, with all string properties

// Actual class is auto-generated from Model1.tt,
// this is what the class looks like conceptually:
public class Product
{
    public string ID { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
}

I’ve done a function import of a stored procedure. Here’s the stored procedure:

create procedure [dbo].[CreateProduct]
    @ID           nvarchar(50),
    @Name         nvarchar(50),
    @Description  nvarchar(255)
as
begin tran
insert [dbo].[Products](
    ID,
    Name,
    Description
)
values (
    @ID,
    @Name,
    @Description
)
commit tran
go

My function import has the following signature:

 CreateProduct(string ID, string Name, string Descritpion);

I’m calling it like this (as a test):

void AddProduct(Product product)
{
    entities.CreateProduct(product.ID, product.Name, product.Description);
}

void Test()
{
    var now = DateTime.Now.ToString();

    var product = new Product
    {
        ID          = string.Format("ID-{0}", now),
        Name        = string.Format("Name-{0}", now),
        Description = string.Format("Description-{0}", now)
    }

    AddProduct(product);
}

My problem is, when I look at what’s inserted into the database (SQL Server 2008), I’m getting the following values:

ID          10/11/2011 10:35:46 AM
Name        NULL
Description NULL

// Note, the ID string is not 'ID-10/11/2011 10:35:46 AM' ('ID-' in front)
  • 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-26T03:22:44+00:00Added an answer on May 26, 2026 at 3:22 am

    Supidity, another test was failing (unrelated), but was causing the issue. Not sure why, but resolving the other test, fixed this problem.

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

Sidebar

Related Questions

I have this schema: <xs:complexType name=foo> <xs:sequence> <xs:element name=oneBar type=xs:string minOccurs=0/> <xs:element name=twoBar type=xs:string
I have an xsd that looks like this (snippet): <xs:complexType name=IDType> <xs:choice minOccurs=1 maxOccurs=2>
I`m trying to display classes that have properties of type some custom class inside
I have a complex type defined which doesn't currently contain any minOccurs restrictions. When
I'm using VS2010 Beta 2, I have a Complex Type called Address with the
I have a List of a complex type - an object with a few
I have 2 separate java services that use a complex type that is a
I have an xml with an xml-schema. The xml-schema defines an abstract complex type
I have a Dictionary<Guid, ElementViewModel> . (ElementViewModel is our own complex type.) I add
I have some code like this: Object doMethod(Method m, Object... args) throws Exception {

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.