Unexpected problem inserting


Author
Message
Daniel Essin
Daniel Essin
StrataFrame User (275 reputation)StrataFrame User (275 reputation)StrataFrame User (275 reputation)StrataFrame User (275 reputation)StrataFrame User (275 reputation)StrataFrame User (275 reputation)StrataFrame User (275 reputation)StrataFrame User (275 reputation)StrataFrame User (275 reputation)
Group: Forum Members
Posts: 235, Visits: 309
This is the code:

_EntityProgram.Add();

_EntityProgram.MRN = _Entity.MRN;

_EntityProgram.EnrolledProgram = comboPrograms.Text;

_EntityProgram.Save();



_EntityProgram is an instance of a BO



This is the DDL for the table behind the BO:

CREATE TABLE [dbo].[EntityProgram] (

   [MRN] [varchar] (36) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

   [EnrolledProgram] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL

) ON [PRIMARY]

GO



ALTER TABLE [dbo].[EntityProgram] WITH NOCHECK ADD

   CONSTRAINT [PK_EntityProgram] PRIMARY KEY CLUSTERED

   (

      [MRN],

      [EnrolledProgram]

   Wink ON [PRIMARY]

GO



It's complaining about converting varchar to numeric but both fields are varchar and both are part of the PK.



This is the Error:

Cannot insert the value NULL into column 'EnrolledProgram', table 'CRM.dbo.EntityProgram'; column does not allow nulls. INSERT fails.

Error converting data type varchar to numeric.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search