|
|
 |
| SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

March 13th, 2008, 12:33 PM
|
|
Registered User
|
|
Join Date: Mar 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error converting data type varchar to int. - SQL
Hi! I wrote a simple stored procedure to add a few fields into a MsSQL table:
Code:
INSERT INTO dbo.xyz769_Blog_01_Comments
(Blog_01ID, Blog_01_Title, Username, Comment_Content, Email)
VALUES (@Blog_01ID, @Blog_01_Title, @Username, @Comment_Content, @Email)
But whenever i try to insert data thru an ASP page i get the following error:
Code:
Microsoft OLE DB Provider for SQL Server error '80040e07'
Error converting data type varchar to int.
/anti_sql/pages/blog_01/blog_item.asp, line 73
Line 73 on blog_item.asp is just my execution statement which is the following:
Code:
rsEnterRecord_cmd.Execute
I tested to see which parameter was causing the problem, and after I went thru each one, I found out that when I enabled the @Email parameter it gives me this error.
My Parameters are created on the ASP page through following statements:
Code:
rsEnterRecord_cmd.Parameters.Append rsEnterRecord_cmd.CreateParameter("@Blog_01ID", 3, 1)
rsEnterRecord_cmd.Parameters.Append rsEnterRecord_cmd.CreateParameter("@Blog_01_Title", 200, 1, 200)
rsEnterRecord_cmd.Parameters.Append rsEnterRecord_cmd.CreateParameter("@Username", 200, 1, 50)
rsEnterRecord_cmd.Parameters.Append rsEnterRecord_cmd.CreateParameter("@Comment_Content", 200, 1, 255)
rsEnterRecord_cmd.Parameters.Append rsEnterRecord_cmd.CreateParameter("@Email", 200, 1, 200)
In the database table:
Blog_01ID is Integer
Blog_01_Title is nvarchar
Email is nvarchar
Comment_Content is nvarchar
Username is nvarchar
I really don't see where the problem is, and I've run out of ideas, please help ....
|

March 17th, 2008, 12:56 AM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Location: India
Posts: 587
Thanks: 0
Thanked 22 Times in 22 Posts
|
|
Hi,
What is the data types of fields in dbo.xyz769_Blog_01_Comments table?
Om Prakash
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |