473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Failed sql SP from EnterpriseLibrary

Hi,

I'm attempting to run a SQL SP from ASP.NET 1.1 using the
EnterpriseLibrary. I have successfully creted a connection and am
attempting to call the ExecuteScalar method. The problem is that my SP
is always returning a value of zero when it should (under the right
conditions) return a one. When called from the QA or EM the SP does
return the correct results, it's just from the code it doesn't.

Here's my VB:

<Start Code>
Public Function Login(ByVal strUserName As String, _
ByVal strPassword As String) As Integer

Dim nID As Integer = 1
Dim sqlCommand As String
Dim dbCommandWrapper As DBCommandWrapper

sqlCommand = "procUserValidate"
dbCommandWrapper =
db.GetStoredProcCommandWrapper(sqlCommand)

Call dbCommandWrapper.AddInParameter("@vchUser",
DbType.String, strUserName)
Call dbCommandWrapper.AddInParameter("@vchPword",
DbType.String, strPassword)
Call dbCommandWrapper.AddOutParameter("@bValid",
DbType.Int16, 1)

Try
nID = CType(db.ExecuteScalar(dbCommandWrapper),
Integer)
Catch e As Exception
Throw e
End Try

Return nID
End Function
</End Code>

.... and here's the SP it's calling...

<Start SQL>
CREATE PROCEDURE procUserValidate
@vchUser typUserUsername,
@vchPword typUserPassword,
@bValid BIT OUTPUT

AS

IF EXISTS(
SELECT GUID
FROM dbo.tblUsers (NOLOCK)
WHERE Username = @vchUser
AND [Password] = @vchPword
)
SET @bValid = 1
ELSE
SET @bValid = 0
</End SQL>

I think It's something to do with the DataTypes defined in the code,
but any pointers would be appreciated.

<M>

Nov 5 '07 #1
0 755

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mairead O' Donovan | last post by:
From: davidkeaveny@gmail.com (CtrlAltDel) Newsgroups: microsoft.public.dotnet.datatools Subject: Unit-testing applications that use the Microsoft.Patterns.EnterpriseLibrary.Data Date: 15 Apr 2005...
2
by: Jake_adl | last post by:
Is there any way to create a Microsoft.Practices.EnterpriseLibrary.Data.Database object without reading from a configuration file? I am writing a utility that manages databases in SQL Server....
2
by: A TO Consultant | last post by:
Hi All, We are using Microsoft.Practices.EnterpriseLibrary.Logging version 1.1.0.0 successfully with .NET code. There is a problem when we try to log from non-.NET code through interop. We get...
0
by: job | last post by:
Mohamed Sharaf's has produced a Microsoft.Practices.EnterpriseLibrary production server installer: https://blogs.msdn.com/mohamed_sharafs_blog/archive/2005/09/18/470854.aspx Running the...
0
by: rajesh.hanchate | last post by:
Please help me in resolving this issue. I am using EnterpriseLibrary 2.0 Exception and logging block for logging exceptions to event log. It works fine for sometime. After some time it stops...
0
by: Karthik | last post by:
Hi all, I am novice to the VB .net I don't know How to create a Connection with SQL server Using the Microsoft.Practise.EnterpriseLibrary? Where do i give the ConnectionString? I am...
0
by: sloan | last post by:
Is anyone else using the Microsoft Practices EnterpriseLibrary conventions for naming FILES (.cs) as far as a non-generic and generic implementation is concerned? Anyone have an alternative? ...
1
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
Can anyone offer pointers to articles/examples of passing a Ref Cursor ***IN*** to an Oracle stored procedure. I find tons of examples for getting a ref cursor OUT of a stored procedure. I'm using...
1
by: Author | last post by:
It looks like that there is very little resource about the Enterprise Library on the Web. I know it is documented at msdn, but I haven't found a whole lot sample codes. I was trying out the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.