I have deployed the starter kit to a live environment. everything seemed to work ok. but when I try to submit a resume i get a database error:
Server Error in '/' Application.
Cannot insert the value NULL into column 'ResumeID', table 'findacrt.dbo.JobsDb_Resumes'; column does not allow nulls. INSERT fails.
The statement has been terminated.
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.SqlClient.SqlException: Cannot insert the value NULL into column 'ResumeID', table 'findacrt.dbo.JobsDb_Resumes'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Source Error:
Line 132: strLastError=ex.Message; Line 133: else Line 134: throw; Line 135: } Line 136: catch
Did this application work in your development env't?
Do you understand the error? In case not, it can't perform a database Insert for a new resume because the primary key field (ResumeID) is null, which, of course, is always a bad thing for a Primary Key.
Did you customize the application? Are you able to debug the application and see why there is no ResumeID being created?
So I figured out that the stored procedure does not create the resume id for inserting into the resume table, instead it uses the auto incrementing integer.
I have to change the identity specification on the target server and then it will work ok.
I should have known this, as it's not the first time I've had this problem...
I am having a similar issue on a UAT environment that is held at a client site in the UK. Basically we do the changes to the stored procs and send them to the UK for deployment and testing. The users testing get the error
Cannotinsert the value NULL into column "QuoteID' on
table DBNAME.dbo.TableName, column does not allow nulls, insert fails.
In our case as well the stored proc does not create the QuoteID, this is auto generated.
Please can you tell me how to go about changing the identity specification on the target server as i am fairly new to SQL Server.
I found that this error was to do with the profile. It does work fine in dev. But when deployed, you need extra stuff in the web.config to declare profile fields. There is a field in the profile with your ResumeID or CompanyID (depending on whether the
user is logged in as a candidate or an employer). This field contains -1 by default.
Also, declarations are required in Web.Config for the WebParts implementation behind the 'My Favourites' tabs.
Here is what I ended up putting in web.config in order to make it work.
<!-- ; now the JSSK profile fields
; -->
<add name="UserName" type="System.String"/>
<add name="Email" type="System.String"/>
<add name="FirstName" type="System.String" allowAnonymous="true"/>
<add name="LastName" type="System.String" allowAnonymous="true"/>
<group name="JobSeeker">
<add name="ResumeID" type="System.Int32" defaultValue="-1"/>
</group>
<group name="Employer">
<add name="CompanyID" type="System.Int32" defaultValue="-1"/>
</group>
</properties>
</profile>
<!-- ;
; Declarations for the use of WebParts in my system
; -->
<webParts>
<personalization defaultProvider="SqlProvider">
<providers>
<add name="SqlProvider" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider"
connectionStringName="ConnectionString" applicationName="Sampler"
description="Sql WebParts Personalisation Provider for Dolphin" />
</providers>
<authorization>
<deny users="*" verbs="enterSharedScope" />
<allow users="*" verbs="modifyState" />
</authorization>
</personalization>
</webParts>
petermeadit
Member
653 Points
179 Posts
Live Site Error: Cannot insert the value NULL into column 'ResumeID'
Jan 14, 2008 08:08 AM|LINK
Hello,
I have deployed the starter kit to a live environment. everything seemed to work ok. but when I try to submit a resume i get a database error:
Server Error in '/' Application.
Cannot insert the value NULL into column 'ResumeID', table 'findacrt.dbo.JobsDb_Resumes'; column does not allow nulls. INSERT fails.
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.The statement has been terminated.
Exception Details: System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'ResumeID', table 'findacrt.dbo.JobsDb_Resumes'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Source Error:
Source File: d:\websites\www.findacrt.com.au\App_Code\DAL\DBAccess.cs Line: 134
geosync
Contributor
2370 Points
768 Posts
Re: Live Site Error: Cannot insert the value NULL into column 'ResumeID'
Jan 14, 2008 08:28 AM|LINK
Did this application work in your development env't?
Do you understand the error? In case not, it can't perform a database Insert for a new resume because the primary key field (ResumeID) is null, which, of course, is always a bad thing for a Primary Key.
Did you customize the application? Are you able to debug the application and see why there is no ResumeID being created?
ca8msm
Star
12439 Points
2153 Posts
Re: Live Site Error: Cannot insert the value NULL into column 'ResumeID'
Jan 14, 2008 08:28 AM|LINK
You'll need to trace through the code to see why this is not being added to the sql statement or stored procedure.
Website Design Darlington - http://lessthandot.com -
http://aspnetlibrary.com
petermeadit
Member
653 Points
179 Posts
Re: Live Site Error: Cannot insert the value NULL into column 'ResumeID'
Jan 14, 2008 08:49 AM|LINK
Yes the site was working in the dev environment...
I will try a trace on it...
Thanks
petermeadit
Member
653 Points
179 Posts
Re: Live Site Error: Cannot insert the value NULL into column 'ResumeID'
Jan 14, 2008 10:07 AM|LINK
I wonder if it has anything to do with the way that i deployed it to the live server?
First i imported every table and view to the live database, then i ran and sql query with all the stored procedures in it.
It seemed like the most straight forward way to deploy it.
Any thoughts?
TIA
petermeadit
Member
653 Points
179 Posts
Re: Live Site Error: Cannot insert the value NULL into column 'ResumeID'
Jan 14, 2008 11:43 AM|LINK
So I figured out that the stored procedure does not create the resume id for inserting into the resume table, instead it uses the auto incrementing integer.
I have to change the identity specification on the target server and then it will work ok.
I should have known this, as it's not the first time I've had this problem...
Cheers
bramsewak@po...
Member
2 Points
1 Post
Re: Live Site Error: Cannot insert the value NULL into column 'ResumeID'
Apr 14, 2009 10:57 AM|LINK
Hi
I am having a similar issue on a UAT environment that is held at a client site in the UK. Basically we do the changes to the stored procs and send them to the UK for deployment and testing. The users testing get the error Cannot insert the value NULL into column "QuoteID' on table DBNAME.dbo.TableName, column does not allow nulls, insert fails.
In our case as well the stored proc does not create the QuoteID, this is auto generated.
Please can you tell me how to go about changing the identity specification on the target server as i am fairly new to SQL Server.
many thanks,
Bharthi
development
geosync
Contributor
2370 Points
768 Posts
Re: Live Site Error: Cannot insert the value NULL into column 'ResumeID'
Apr 14, 2009 12:38 PM|LINK
If the error is Cannot insert the value NULL into column "QuoteID', then QuoteID probably isn't being auto-generated.
Double-check that QuoteID in the table where the problem occurs has an Identity specification assigned to it.
You should see something like this:
CREATE TABLE [yourTableNameHere](QuoteID int IDENTITY(1,1) NOT NULL, ...
If you need more help, post the SQL defining the problem table, and the procedure you're using.
Hyacinth Bro...
Member
64 Points
42 Posts
Re: Live Site Error: Cannot insert the value NULL into column 'ResumeID'
Apr 25, 2009 12:58 AM|LINK
I found that this error was to do with the profile. It does work fine in dev. But when deployed, you need extra stuff in the web.config to declare profile fields. There is a field in the profile with your ResumeID or CompanyID (depending on whether the user is logged in as a candidate or an employer). This field contains -1 by default.
Also, declarations are required in Web.Config for the WebParts implementation behind the 'My Favourites' tabs.
Here is what I ended up putting in web.config in order to make it work.
<!-- ; now the JSSK profile fields ; --> <add name="UserName" type="System.String"/> <add name="Email" type="System.String"/> <add name="FirstName" type="System.String" allowAnonymous="true"/> <add name="LastName" type="System.String" allowAnonymous="true"/> <group name="JobSeeker"> <add name="ResumeID" type="System.Int32" defaultValue="-1"/> </group> <group name="Employer"> <add name="CompanyID" type="System.Int32" defaultValue="-1"/> </group> </properties> </profile> <!-- ; ; Declarations for the use of WebParts in my system ; --> <webParts> <personalization defaultProvider="SqlProvider"> <providers> <add name="SqlProvider" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider" connectionStringName="ConnectionString" applicationName="Sampler" description="Sql WebParts Personalisation Provider for Dolphin" /> </providers> <authorization> <deny users="*" verbs="enterSharedScope" /> <allow users="*" verbs="modifyState" /> </authorization> </personalization> </webParts>