Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 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 October 23rd, 2007, 02:26 PM
Registered User
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Output parameter sybase C#

Hi



I have a Sybase stored procedure with an output type char parameter (Also it has one Input parameter).



When I try to get the value's parameter I get an NullReferenceException, Object reference not set to an instance.



I debug my web application it shows:


'((Sybase.Data.AseClient.AseParameter)((new System.Collections.ArrayList.ArrayListDebugView(_o Comando.Parameters)).Items[1])).Value' threw an exception of type 'System.NullReferenceException'



My code of this parameters is



AseParameter oParameter = new AseParameter("@outParameter", AseDbType.Char, 10);

oParameter.Direction = ParameterDirection.Output;

_oComando.Parameters.Add(oParameter);



What's wrong?



Regards



 
Old October 24th, 2007, 02:11 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Is Items a method or a property, if the former then you need () not []. Do you need that complex syntax, can't you just read _oComando.Parameters[1].Value?

--

Joe (Microsoft MVP - XML)
 
Old October 24th, 2007, 03:17 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I suspect the complex syntax is what the debugger is throwing out as ArrayListDebugView is a hidden internal framework class.

Also, you've posted this same topic twice. Please try and avoid that if you expect everyone to work together on an answer.

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Capturing Output Parameter Value GailCG SQL Server 2005 1 November 19th, 2008 08:52 AM
output parameter SKhna ASP.NET 2.0 Basics 3 February 25th, 2008 10:58 AM
SqlDbType.Xml Output Parameter needs a size - Why? francislang ADO.NET 1 January 28th, 2008 08:28 PM
How to return an output parameter dyaneshwaran SQL Language 0 January 12th, 2006 05:29 AM





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