Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2008, 11:33 AM
Registered User
 
Join Date: Mar 2008
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:

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

 
Old March 16th, 2008, 11:56 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Hi,

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



Om Prakash





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





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