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 8553071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:33:58+00:00 2026-06-11T14:33:58+00:00

I have a service method like this: [OperationContract] public void CreateIcd9(int icd9ID, string code,

  • 0

I have a service method like this:

[OperationContract]
public void CreateIcd9(int icd9ID, string code, string description, string specialty)
{          
    var count = from icd in clogicEntities.ICD9
                where icd.ID == icd9ID
                select icd;

    if (count.Count() >= 1)
    {
        var icd9 = clogicEntities.ICD9.Where(icd => (icd.ID == icd9ID)).SingleOrDefault();
        if (icd9 != null)
        {
            icd9.CODE = code;
            icd9.DESCRIPTION = description;
            icd9.SPECIALTY = specialty;
        }
    }
    else
    {
         ICD9 icdNew =  new ICD9()
         {
             ID = icd9ID,
             CODE = code,
             DESCRIPTION = description,
             SPECIALTY = specialty
         };                

        // Insert Icd9
        clogicEntities.ICD9.AddObject(icdNew);
    }

    clogicEntities.SaveChanges();
}

Everything is ok until today, i got a exception when call this method with icd9ID = 1992401733
i got this exception:

An error occurred while updating the entries. 
See the inner exception for details. ----> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'ID', table '1224-CLOGIC.dbo.ICD9'; column does not allow nulls. INSERT fails.
The statement has been terminated

I try to reproduce this issue but no luck, i wonder it’s MAX Int problem:
2147483647 – MAX Int
1992401733 – My value
Please help me.

  • 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-06-11T14:34:00+00:00Added an answer on June 11, 2026 at 2:34 pm

    i found my problem is the ICD9 table on EF with ID(pk) Identity(1,1) but on SQL ICD9 table – ID(pk) Identity = false so when

    clogicEntities.ICD9.AddObject(icdNew);
    

    it just pass 3 values (Code, Description, Specialty) without ID to SQL.
    And reason why i passed 0 int value to service is i forgot update service reference after change parameter.

    Regards.

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

Sidebar

Related Questions

I have a wcf service defined like this: [OperationContract] [WebInvoke(Method = POST, ResponseFormat =
I have a web method like this as part of a web service public
I have a RESTful WCF service with a method declared like this: [OperationContract(Name =
I have a WCF service code like this: [ServiceContract] [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode =
I have a service contract interface that looks like this: [ServiceKnownType(typeof(GeometricModelDescriptor))] [ServiceKnownType(typeof(TemplateModelDescriptor))] [ServiceContract] public
I have created a WCF service and have its operationcontract and implementation like this:
My WCF Service in C# looks like this. [ServiceContract] public class MySecretService { [OperationContract]
I have an interface similar to this: [ServiceContract] public interface IBaseService<T> { [OperationContract] [WebInvoke(Method
I have a web service method where I would like to throw some custom
I have to map a REST Webservice URL like http://server:8080/application/service/customer/v1 to createCustomer method in

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.