|
I have to write a stored procedure that would return me some value so that i can do something on the basis of that return value:
The SP code is:
CREATE PROCEDURE sp_isvalidlogin
@UserID varchar(16),
@Password varchar(16),@i nchar(2) output
As
if exists(Select * From Authenticate
Where UserID = @UserID
And
Password = @Password)
set i=1
else
set i=0
Is this definiton alright ... ihave to return a value if this userid and password exists in the database and perform something on the basis of return value.
if returned what is the code in c# to receive that value ....
The table consists of these two fields:
userid and password.
Urgent help needed..
|
|
|
|
|
Please don't remove messages from threads, as you did with the previous thread. It messes up the forum.
--
You have forgotten the @ before the variable name when you set it:
...<br />
set @i = 1<br />
else<br />
set @i = 0
I suggest that you use a data type that is more convenient for the output value, like int . If you really want to return the number as a two character string, you have to assign string values to the variable:
...<br />
set @i = '1'<br />
else<br />
set @i = '0'
To retrieve the value in C#, you add a parameter with the direction ParameterDirection.Output , and read the value from it's Value property after calling the procedure.
---
single minded; short sighted; long gone;
|
|
|
|
|
bro.. i dont have output parameters to the procedure and still i want to return a value can i do that and how will i receive it the code of sp is given below:
create PROCEDURE sp_IsValidLogon
@UserID nvarchar(16),
@Password nvarchar(16)
As
if exists(Select * From Authenticate
Where UserID = @UserID
And
Password = @Password)
begin
return(1)
end
else
return (0)
|
|
|
|
|
You add a parameter object with the direction ParameterDirection.ReturnValue and read the value from the Value property after executing the procedure.
---
single minded; short sighted; long gone;
|
|
|
|
|
bro..can u tell me the exact code..i cannot figure it out.
|
|
|
|
|
Hi all,
Is it possible to highlight rows and respective columns of the datagrid on mouseover using javascript? If so can you give me a link or code to do that?
ayyp
|
|
|
|
|
Hope the Article by Gary Dryden[^] will help you.
Regards,
Satips.
|
|
|
|
|
How do u get the commandline (arguments) of another process?
I example if i use run like so: notepad.exe test.txt
I would like my program to return test.txt or whatever the argument might be.
Thanks!
|
|
|
|
|
So far as I know this cannot be done for another process, only for your own program.
|
|
|
|
|
Hi,
it must be possible, utilities such as TaskInfo do it, but I dont know how...
|
|
|
|
|
Yup process explorer as well but i cant find any info on howto :S
|
|
|
|
|
Found it:
- see Process class
- use whatever static methods there you need to get to the right Process
- then look at theProcess.StartInfo.Arguments
|
|
|
|
|
Somebody already said that and it doesnt work.
|
|
|
|
|
it works for me.
if you want more help, show your code and results.
|
|
|
|
|
Hi,
We recently migrated one of our client's database (for our Application) from SQL 2000 to SQL 2005 server. Now its being told that there are issues with the application. Do we have to make changes to SPs and other queries while migrating to Sql 2005 database? Or is there other changes or settings to be made, has anyone come across such an issue?
Regards,
Blumen
|
|
|
|
|
Perhaps it would help if you care to mention what "issues" your application is facing. All SQL 2000 features are supported in 2005. As for settings, yes, SQL 2005 by default switches off a lot of features for reasons of security. You need to turn em on. Again, for this, it'll help if I know where your application is breaking. If you're using extended procs or link to other databases, you need to set permissions again in your current instance.
SG
|
|
|
|
|
Thanks alot for the information. I was told there were some issues at the client side, and no other details. I was curious about the changes in migration, so I posted the question here.
Regards,
Blumen
|
|
|
|
|
|
Add a parameter with direction ParameterDirection.ReturnValue .
---
single minded; short sighted; long gone;
|
|
|
|
|
You will need to execute command which has a parameter that has parameter direction ParameterDirection .Output
|
|
|
|
|
Hi,
I have created Installer Patch using "Setup and Deployment" option.
everything is working except Reports. I think Crystal Reports services files are not including when I create Installer patch. so thats why my reports are not working.
Is there any method to add Crystal Reports Services/Runtime files etc?
Kindly help me.
Thank you
|
|
|
|
|
Hi Riaz
If you create setup and deployment wizard(windows form), the crystal report is an 3rd party tool, so that necessary dependancy files are to be need to run crystal report in client machine. for this reason, their is a option in crystal report to create distribution package to your .rpt files.it convert .rpt to .exe files, this will create setup files containing all your .rpt files to .exe file. You may instal this distribution package into client machine, it makes ur client mechine have necessary dependancy files.
Regards
Arunkumar Sundaravelu
|
|
|
|
|
Hi, Mr Arunkumar Sundaravelu
I was too embarrassed to solve this problem. Thanks for your reply.
now i am trying.
Thank you
|
|
|
|
|
i've been trying to see how to retrieve texts from notepad to a rich textbox and don't knpw the technicalities involve. pls come to my rescue
ma coding life
|
|
|
|
|
What you want is GetWindowText api
Google:C# GetWindowText api[^]
Read serveral articles on this. There will be other api calls that you wil need to call to make this work and this may not work with some windows.
|
|
|
|