Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) 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 January 11th, 2004, 08:18 PM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default MX2004 Stored Procedure Problem

Hi,

I'm getting a error from my asp.net page that is getting the best of me. I'm executing a stored procedure from a sub. The stored procedue checks user information and returns a user level. In the sub I'm referencing the parameter values for the user level. This value is what appears to be causing the error. I've checked the stored procedure and verified that it is returning data. Below is some of the code and the error.

:(Please Help, thanks.

sub btnLoginSubmit (sender as object, e as eventargs)
...
session("uguid")=uguid
spVerifyAUser.Expression="true"
databind()
dim uLevel as string
ulevel=spVerifyAUser.ParameterValue("@ulvl") <- Line with the error
response.write("UserLevel="&uLevel)
...
end sub

<MM:DataSet
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_Server1") %>'
CommandText="dbo.VerifyAUser"
CreateDataSet="false"
Debug="true"
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETYPE_Server1") %>' Expression="false"
id="spVerifyAUser"
IsStoredProcedure="true"
runat="Server"
>
<Parameters>
<Parameter Name="@RETURN_VALUE" Type="Int" Direction="ReturnValue" />
<Parameter Name="@uguid" Value='<%# Session("uguid") %>' Type="VarChar" Size="100" Direction="Input" />
<Parameter Name="@ulvl" Type="Char" Size="1" Direction="Output" /> </Parameters>
</MM:DataSet>

ERROR:
Object reference not set to an instance of an object.
NullReferenceException: Object reference not set to an instance of an object.]
DreamweaverCtrls.DataSet.ParameterValue(String ParameterName)
ASP.Login_aspx.btnLoginSubmit(Object sender, EventArgs e) in c:\inetpub\wwwroot\myauction2\Login.aspx:51
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277


 
Old March 1st, 2005, 07:43 PM
Registered User
 
Join Date: Feb 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Looks like this is a very old post, but thought I'd add my 2 cents. Add .value to the offending code string, like this:

ulevel=spVerifyAUser.ParameterValue("@ulvl").value






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with stored procedure analuz ADO.NET 1 July 18th, 2007 08:33 AM
Stored procedure problem akumarp2p Reporting Services 1 May 29th, 2007 01:25 AM
Stored Procedure Problem kwilliams SQL Server 2000 7 June 23rd, 2006 03:03 PM
Problem In Stored procedure mistry_bhavin Oracle 1 October 11th, 2005 05:15 AM
Stored Procedure Problem brettdavis4 ASP.NET 1.0 and 1.1 Basics 7 November 3rd, 2003 09:46 PM





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