Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 software programmers and website developers 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 developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 13th, 2008, 11:33 AM
Registered User
Join Date: Mar 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error converting data type varchar to int. - SQL

Hi! I wrote a simple stored procedure to add a few fields into a MsSQL table:

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:

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:

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:
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 ....

Reply With Quote
  #2 (permalink)  
Old March 16th, 2008, 11:56 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts


What is the data types of fields in dbo.xyz769_Blog_01_Comments table?

Om Prakash
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cast varchar as int SQL Server 2005 mr_pc1963 SQL Language 2 April 23rd, 2008 06:09 AM
Syntax error converting the varchar value... Earl Hickey ASP.NET 2.0 Basics 5 January 23rd, 2008 10:25 PM
Data type change from int to Varchar getxyz SQL Server 2000 1 April 29th, 2005 09:59 AM
Error converting data type nvarchar to datetime. Andreas ADO.NET 2 August 18th, 2004 03:03 AM
Error converting data type varchar to float. Trojan_uk SQL Server ASP 5 April 27th, 2004 02:56 AM

All times are GMT -4. The time now is 08:14 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.