I am having problems inserting data into a simple table
Insert into Forums (Title, PageUrl, ContractId) Values ('54249',
'test01.asp',54249)
Microsoft OLE DB Provider for SQL Server error '80040e2f'
Cannot insert the value NULL into column 'ForumID', table
'LegalOnline.dbo.Forums'; column does not allow nulls. INSERT fails.
/sqllegal/submitcontract.asp, line 214
My table structure is below
ForumId Int 4 (identity column)
Title nvarchar 50
PageUrl nvarchar 250
contractid numeric 9(10,0)
if i copy and paste the above query in sql query analyzer and run it it
works perfectly but not through asp code.
can someone help
thanks 2 2099
JP SIngh wrote: I am having problems inserting data into a simple table
Insert into Forums (Title, PageUrl, ContractId) Values ('54249', 'test01.asp',54249) Microsoft OLE DB Provider for SQL Server error '80040e2f'
Cannot insert the value NULL into column 'ForumID', table 'LegalOnline.dbo.Forums'; column does not allow nulls. INSERT fails.
The error message implies that the ForumID column is not an identity column.
Use Profiler to trace what is actually being executed on the SQL Server when
the error is generated..
My table structure is below
ForumId Int 4 (identity column)
Title nvarchar 50
PageUrl nvarchar 250
contractid numeric 9(10,0)
This does not help. If Profiler does not provide your solution, in
Enterprise Manager, right-click your table and select All Tasks / Generate
SQL Script and show us the generated script.
We will also need to see the code used to run the INSERT.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
It looks like ForumID is not an Identity Column
Try this then.
Insert into Forums (ForumID, Title, PageUrl, ContractId)
Values (1,'54249','test01.asp',54249)
Good Luck.!
"JP SIngh" <no**@none.com> wrote in message
news:u2**************@TK2MSFTNGP14.phx.gbl... I am having problems inserting data into a simple table
Insert into Forums (Title, PageUrl, ContractId) Values ('54249', 'test01.asp',54249) Microsoft OLE DB Provider for SQL Server error '80040e2f'
Cannot insert the value NULL into column 'ForumID', table 'LegalOnline.dbo.Forums'; column does not allow nulls. INSERT fails.
/sqllegal/submitcontract.asp, line 214
My table structure is below
ForumId Int 4 (identity column)
Title nvarchar 50
PageUrl nvarchar 250
contractid numeric 9(10,0)
if i copy and paste the above query in sql query analyzer and run it it works perfectly but not through asp code. can someone help thanks This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: php newbie |
last post by:
Hello,
I am trying to load a simple tab-delimited data file to SQL Server. I
created a format file to go with it, since the data file differs from
the destination table in number of columns.
...
|
by: php newbie |
last post by:
Hello,
I have been trying to load a delimited data file to SQL Server. I
have tried both of the options that are available: each time, I get
different errors. This is on an eval version of SQL...
|
by: iqbal |
last post by:
Hi all,
We have an application through which we are bulk inserting rows into a
view. The definition of the view is such that it selects columns from
a table on a remote server. I have added the...
|
by: adi |
last post by:
Hi all,
Hope there is a quick fix for this:
I am inserting data from one table to another on the same DB. The
insert is pretty simple as in:
insert into datatable(field1, field2, field3)...
|
by: Chris |
last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a
datagrid I utilize the footer to create the 'add' row. The only issue is that
I have it sharing the 'UpDate_Command' and...
|
by: Guadala Harry |
last post by:
In an ASCX, I have a Literal control into which I inject a
at runtime.
litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID);
This works great as long as the contains just...
|
by: pb648174 |
last post by:
I have the following basic statements being executed:
Create a temp table, #TempPaging
Insert Into #TempPaging (Col1, Col2)
Select Col1, Col2 From SomeOtherTable Order By Col2, Col1
Select...
|
by: nano2k |
last post by:
Hi
Shortly, I keep invoices in a table.
Occasionally, someone will fire the execution of a stored procedure
(SP) that performs several UPDATEs against (potentially) all invoices
OLDER than a...
|
by: dublyner |
last post by:
I am having an issue with linked servers on Windows 2000 running SQL 2005.
I created the following test case to simplify an issue. I created a small procedure that selects the max site_no from a...
|
by: =?Utf-8?B?Y2F0?= |
last post by:
We recently moved an older ASP.NET 1.1 code base on to ASP.NET 2.0, .NET 3.0
and Windows 2003 Server SP2. We started experiencing the following issue with
the web cache (the code is straightforward...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |