Click here to Skip to main content
15,899,937 members
Home / Discussions / C#
   

C#

 
GeneralRe: Cast Problem Pin
mav.northwind18-Jul-04 21:47
mav.northwind18-Jul-04 21:47 
GeneralRe: Cast Problem Pin
Reinier van de Wetering18-Jul-04 22:16
Reinier van de Wetering18-Jul-04 22:16 
GeneralRe: Cast Problem Pin
RB@Emphasys19-Jul-04 6:48
RB@Emphasys19-Jul-04 6:48 
QuestionCrystal Reports: Bad performance on some Win2000 systems? Pin
Pain_Elemental18-Jul-04 18:05
Pain_Elemental18-Jul-04 18:05 
AnswerRe: Crystal Reports: Bad performance on some Win2000 systems? Pin
Daniel Turini19-Jul-04 6:09
Daniel Turini19-Jul-04 6:09 
GeneralRe: Crystal Reports: Bad performance on some Win2000 systems? Pin
Pain_Elemental19-Jul-04 20:57
Pain_Elemental19-Jul-04 20:57 
GeneralProblem with Stored Procedure's Return value Pin
ronin177018-Jul-04 15:23
ronin177018-Jul-04 15:23 
GeneralRe: Problem with Stored Procedure's Return value Pin
woudwijk18-Jul-04 21:19
woudwijk18-Jul-04 21:19 
looks to me you got two thing mixed up.

you should eighter change youre sql code to
=======================
CREATE PROCEDURE spCheckLogin
@LoginID char(20), @Pwd char(8), @Response int OUTPUT
AS
IF EXISTS (SELECT * FROM tEmployees WHERE LoginID=@LoginID AND Pwd=@Pwd)
SET @Response=1
ELSE
SET @Response=0
GO
========================

OR you should use something like this in youre code:

========================
string temp="";

//create the sql
string sql = "spCheckLogin";

//create command
cmdLogin = new SqlCommand(sql,gvDatabase.scInventoryControl);
cmdLogin.CommandType=CommandType.StoredProcedure;

cmdLogin.Parameters.Add("@LoginID", SqlDbType.Char,20);
cmdLogin.Parameters["@LoginID"].Value=log;

cmdLogin.Parameters.Add("@Pwd", SqlDbType.Char,8);
cmdLogin.Parameters["@Pwd"].Value=p;

cmdLogin.Parameters.Add("@Response",SqlDbType.Int,4);
cmdLogin.Parameters["@Response"].Direction=ParameterDirection.Output;

Console.WriteLine("Data Access started");
try
{
//open the connection
gvDatabase.scInventoryControl.Open();

//use the connection
temp=(string)cmdLogin.ExecuteScaler();
Console.WriteLine(temp);
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString() );
}
finally
{
//clean up code
gvDatabase.scInventoryControl.Close();
Console.WriteLine("Data Access Closed");
}
cmdLogin.Dispose();
========================

i hope this helps.

(p.s. i did not test above code)


cookies are for eating, not for websites.
GeneralRe: Problem with Stored Procedure's Return value Pin
dishanf19-Jul-04 1:19
dishanf19-Jul-04 1:19 
GeneralCalling richTextBox from other namespaces many times Pin
evdoxos18-Jul-04 13:53
evdoxos18-Jul-04 13:53 
GeneralRe: Calling richTextBox from other namespaces many times Pin
Judah Gabriel Himango18-Jul-04 14:48
sponsorJudah Gabriel Himango18-Jul-04 14:48 
GeneralRe: Calling richTextBox from other namespaces many times Pin
evdoxos18-Jul-04 23:00
evdoxos18-Jul-04 23:00 
GeneralMenu like Windows Start menu Pin
webhay18-Jul-04 10:03
webhay18-Jul-04 10:03 
GeneralRe: Menu like Windows Start menu Pin
Heath Stewart19-Jul-04 3:07
protectorHeath Stewart19-Jul-04 3:07 
GeneralRe: Menu like Windows Start menu Pin
webhay19-Jul-04 7:37
webhay19-Jul-04 7:37 
GeneralRe: Menu like Windows Start menu Pin
Heath Stewart19-Jul-04 8:34
protectorHeath Stewart19-Jul-04 8:34 
GeneralRe: Menu like Windows Start menu Pin
Anonymous19-Jul-04 13:07
Anonymous19-Jul-04 13:07 
GeneralDirect X Picturebox Pin
Wjousts18-Jul-04 9:11
Wjousts18-Jul-04 9:11 
QuestionHow we can dealing with TAPI in C# ? Pin
Wail A.Salem18-Jul-04 7:53
Wail A.Salem18-Jul-04 7:53 
AnswerRe: How we can dealing with TAPI in C# ? Pin
Nick Parker18-Jul-04 10:55
protectorNick Parker18-Jul-04 10:55 
QuestionSubscript button for richtextbox? Pin
BrownJacket18-Jul-04 3:28
BrownJacket18-Jul-04 3:28 
AnswerRe: Subscript button for richtextbox? Pin
mav.northwind18-Jul-04 21:57
mav.northwind18-Jul-04 21:57 
GeneralRe: Subscript button for richtextbox? Pin
BrownJacket19-Jul-04 10:39
BrownJacket19-Jul-04 10:39 
GeneralCreating object using ActiveX Component Pin
Member 32469018-Jul-04 3:10
Member 32469018-Jul-04 3:10 
Generalabout dictionary Pin
ala'a ali18-Jul-04 1:29
sussala'a ali18-Jul-04 1:29 

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.