Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 May 24th, 2007, 01:43 PM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to scandalous Send a message via MSN to scandalous
Default

Thank you very much Dparsons! I am debugging the whole thing now and hopefully will be able to replicate what you have shown me.

 
Old May 24th, 2007, 03:27 PM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to scandalous Send a message via MSN to scandalous
Default

Well this is where I am stuck....

Message="Conversion failed when converting the nvarchar value
'The Company has been Added' to data type int."

this is my @message but it isnt populating my Label as it should be

lblmessage.txt = sMessage


more help would be a blessing!
 
Old May 24th, 2007, 03:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

you are trying to convert an string into an int???

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old May 24th, 2007, 03:51 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This is an error being thrown from your stored procedure; somewhere along the way you are taking a string value and trying to assign it to an int value. I can't help you any further then that, you will need to look at your procedure code.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old May 25th, 2007, 07:05 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to scandalous Send a message via MSN to scandalous
Default

Thanks guys I will review my procedure and let you know how it turns out. FUnny thing is I dont think I have an INT in there except the PK. I wonder if the SCOPE_INDENTITY is what is causing this?

In any event thank you again i will update you!

 
Old May 25th, 2007, 07:14 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Looking over the error, I assume that this:
'The Company has been Added'
is the output of your stored procedure which is an nvarchar. Somewhere along the way you are trying to assign it to an int variable (this is an educated guess in any event). What I would do is, assuming you are using SQL Server, go into query analyzer and execte the stored procedure there and see if that error message is returned (it should be). If it is not, you stated in one of your post that there are alot of other parameters that you did not show us, verifiy that the datatype for each parameter is correct.

So your SqlDbType is SqlDbType.Int, Varchar, etc and the values being passed in match the expected type.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 "Using SQL Output Parameters..." burkecrosby BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 22 February 10th, 2010 05:33 PM
SQL Query output to XML using BCP HELP!! miamikk SQL Language 3 May 15th, 2009 08:22 AM
How to write T-SQL to retrieve the required Output anilkumar.dwivedi SQL Language 3 June 26th, 2008 12:37 AM
Categorizing SQL Output caterpillar SQL Server 2000 2 October 8th, 2006 04:52 PM
SQL output parameters ohiggs SQL Server 2000 4 February 9th, 2004 10:09 PM





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