Click here to Skip to main content
16,005,162 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralClicking with a timer Pin
mykingdomforanewusername25-Feb-08 6:24
mykingdomforanewusername25-Feb-08 6:24 
GeneralRe: Clicking with a timer Pin
Smithers-Jones25-Feb-08 6:46
Smithers-Jones25-Feb-08 6:46 
GeneralRe: Clicking with a timer Pin
Paul Conrad25-Feb-08 8:46
professionalPaul Conrad25-Feb-08 8:46 
GeneralDrag and Drop during runtime Pin
Zaegra25-Feb-08 0:29
Zaegra25-Feb-08 0:29 
GeneralRe: Drag and Drop during runtime Pin
Smithers-Jones25-Feb-08 6:00
Smithers-Jones25-Feb-08 6:00 
GeneralProblem to pass Date parameter value to ReportViewer Pin
sonj25-Feb-08 0:14
sonj25-Feb-08 0:14 
AnswerRe: Problem to pass Date parameter value to ReportViewer Pin
sonj26-Feb-08 3:01
sonj26-Feb-08 3:01 
GeneralHelp with Return value Problem Pin
Vimalsoft(Pty) Ltd24-Feb-08 21:13
professionalVimalsoft(Pty) Ltd24-Feb-08 21:13 
Good Morning All

i have the Following SQl Procedure

<br />
USE [ValRollClients]<br />
GO<br />
/****** Object:  StoredProcedure [dbo].[CheckExistance]    Script Date: 02/25/2008 08:40:08 ******/<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
ALTER Proc [dbo].[CheckExistance]<br />
(<br />
@username varchar(50),<br />
@OldPassword varchar(50),<br />
@OutRes int Output<br />
)<br />
as <br />
set @OutRes =(select count(*) FROM Login WHERE <br />
Username = @username And UPassword = @OldPassword)<br />
<br />


in my Query analyzer i test it like this

<br />
	declare @OutRes varchar(5)<br />
	Exec [CheckExistance] 'vuyiswa','5555',@OutRes Output<br />
	select @OutRes <br />
<br />


if the User Exists it gives me "1" and if not "0"

and i use this Procedure from Vb like this

<br />
 con = New SqlConnection(strcon)<br />
<br />
        cmdselect = New SqlCommand<br />
<br />
        cmdselect.CommandTimeout = 0<br />
<br />
        cmdselect.CommandType = CommandType.StoredProcedure<br />
<br />
        cmdselect.CommandText = "CheckExistance"<br />
<br />
        cmdselect.Connection = con<br />
<br />
        cmdselect.Parameters.Add("@username", "Username")<br />
<br />
        cmdselect.Parameters.Add("@OldPassword", "strPassword")<br />
<br />
        cmdselect.Parameters.Add("@OutRes", SqlDbType.Int)<br />
<br />
        cmdselect.Parameters("@OutRes").Direction = ParameterDirection.Output<br />
<br />
        Dim bolres As Boolean<br />
<br />
        Dim intRes As Integer<br />
<br />
        Try<br />
            con.Open()<br />
<br />
<br />
            intRes = cmdselect.ExecuteScalar()<br />
<br />
            intRes = cmdselect.Parameters("@OutRes").Value<br />
<br />
<br />
            Select Case intRes<br />
                Case 1<br />
                    bolres = True<br />
                Case 0<br />
                    bolres = False<br />
<br />
            End Select<br />
            con.Close()<br />
<br />
        Catch ex As SqlClient.SqlException<br />
<br />
            MsgBox(ex.Message)<br />
<br />
        End Try<br />
<br />
        Return bolres<br />
<br />
<br />


but my Boolean value will be false, that means it always brings "0"

what is the Problem

Thanks

Vuyiswa Maseko,

Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding

VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za


GeneralRe: Help with Return value Problem Pin
Christian Graus24-Feb-08 21:30
protectorChristian Graus24-Feb-08 21:30 
GeneralRe: Help with Return value Problem Pin
Vimalsoft(Pty) Ltd24-Feb-08 22:03
professionalVimalsoft(Pty) Ltd24-Feb-08 22:03 
GeneralRe: Help with Return value Problem Pin
Christian Graus24-Feb-08 22:59
protectorChristian Graus24-Feb-08 22:59 
GeneralRe: Help with Return value Problem Pin
Vimalsoft(Pty) Ltd24-Feb-08 23:26
professionalVimalsoft(Pty) Ltd24-Feb-08 23:26 
GeneralRe: Help with Return value Problem Pin
J4amieC24-Feb-08 23:23
J4amieC24-Feb-08 23:23 
GeneralRe: Help with Return value Problem Pin
Christian Graus25-Feb-08 9:30
protectorChristian Graus25-Feb-08 9:30 
Questionhow to query pass to crystalreport using vb net Pin
Parvai24-Feb-08 21:07
Parvai24-Feb-08 21:07 
QuestionHow To restrict The Opening of Multliple Login Screens of a VB.Net Application ? Pin
Balagurunathan S24-Feb-08 20:36
Balagurunathan S24-Feb-08 20:36 
AnswerRe: How To restrict The Opening of Multliple Login Screens of a VB.Net Application ? Pin
Christian Graus24-Feb-08 21:32
protectorChristian Graus24-Feb-08 21:32 
GeneralChange the icon Pin
dnsl24-Feb-08 20:15
dnsl24-Feb-08 20:15 
GeneralRe: Change the icon Pin
Smithers-Jones24-Feb-08 21:23
Smithers-Jones24-Feb-08 21:23 
Generaldoubt in VB.Net "split" method Pin
MS Lee24-Feb-08 19:40
MS Lee24-Feb-08 19:40 
GeneralRe: doubt in VB.Net "split" method Pin
Mycroft Holmes24-Feb-08 19:57
professionalMycroft Holmes24-Feb-08 19:57 
GeneralRe: doubt in VB.Net "split" method Pin
MS Lee24-Feb-08 20:24
MS Lee24-Feb-08 20:24 
GeneralRe: doubt in VB.Net "split" method Pin
Mycroft Holmes24-Feb-08 20:41
professionalMycroft Holmes24-Feb-08 20:41 
Generalvb.net Pin
Member 125837324-Feb-08 13:50
Member 125837324-Feb-08 13:50 
GeneralRe: vb.net Pin
Dave Kreskowiak25-Feb-08 10:39
mveDave Kreskowiak25-Feb-08 10:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.