In my localmachine everything is working fine. But online only Update, Delete and Select statements are working correctly, while INSERT doesn't work and I got a similar error to this when I try to insert any data into any table:
Server Error in '/' Application.
Cannot insert the value NULL into column 'messageId', table 'db.dbo.mail'; 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 'messageId', table 'db.dbo.mail'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
So wat's wrong?
Note: 1-The Insert statement work correctly in localmachine.
2-The application and the sql database are both in remote hosts.
3-The application configuration had been checked and is correct.
Thanks a lot gopalanmani! It was all about autoincrement! When I copied the Database to the destination, id didn't copied the AutoIncrement condition, so I've done this manually and it works.
jocker_wow
Member
129 Points
89 Posts
Insert not working on remote machine!
Dec 13, 2007 01:29 PM|LINK
Hi,
In my localmachine everything is working fine. But online only Update, Delete and Select statements are working correctly, while INSERT doesn't work and I got a similar error to this when I try to insert any data into any table:
Server Error in '/' Application.
Cannot insert the value NULL into column 'messageId', table 'db.dbo.mail'; 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 'messageId', table 'db.dbo.mail'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Source Error:
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
So wat's wrong?
Note:
1-The Insert statement work correctly in localmachine.
2-The application and the sql database are both in remote hosts.
3-The application configuration had been checked and is correct.
M.Nagieb
Sr. Web Developer
gopalanmani
Star
7826 Points
1320 Posts
Re: Insert not working on remote machine!
Dec 13, 2007 05:15 PM|LINK
Incase in localy your database messageid column contain autoincrement. But remote server does not.
so compare the local and server database tables ('db.dbo.mail' )
Gopalan Mani
My Tech blog
jocker_wow
Member
129 Points
89 Posts
Re: Insert not working on remote machine!
Dec 14, 2007 10:30 AM|LINK
Hey gopalanmani,
I didn't thought about that before, I'll try soon just after my holiday!
Thanks again!
M.Nagieb
Sr. Web Developer
jocker_wow
Member
129 Points
89 Posts
Re: Insert not working on remote machine!
Jan 07, 2008 06:54 AM|LINK
Thanks a lot gopalanmani! It was all about autoincrement! When I copied the Database to the destination, id didn't copied the AutoIncrement condition, so I've done this manually and it works.
Thanks again!
M.Nagieb
Sr. Web Developer