p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

Go Back   p2p.wrox.com Forums > SQL Server > SQL Server ASP
I forgot my password
Register Now
Register | 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 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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 13th, 2008, 12:33 PM
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:

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old March 17th, 2008, 12:56 AM
Friend of Wrox
Points: 2,050, Level: 18
Points: 2,050, Level: 18 Points: 2,050, Level: 18 Points: 2,050, Level: 18
Activity: 22%
Activity: 22% Activity: 22% Activity: 22%
 
Join Date: May 2004
Location: India
Posts: 587
Thanks: 0
Thanked 22 Times in 22 Posts
Default

Hi,

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



Om Prakash
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cast varchar as int SQL Server 2005 mr_pc1963 SQL Language 2 April 23rd, 2008 07: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 10:59 AM
Error converting data type nvarchar to datetime. Andreas ADO.NET 2 August 18th, 2004 04:03 AM
Error converting data type varchar to float. Trojan_uk SQL Server ASP 5 April 27th, 2004 03:56 AM



All times are GMT -4. The time now is 07:45 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 Wiley Publishing, Inc