Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 October 23rd, 2007, 02:26 PM
Registered User
 
Join Date: Oct 2007
Location: , , Mexico.
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



  #2 (permalink)  
Old October 24th, 2007, 02:11 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
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)
  #3 (permalink)  
Old October 24th, 2007, 03:17 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
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 -/
 


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



All times are GMT -4. The time now is 11:36 PM.


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