|
Sounds like you need a union .
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Vikram A Punathambekar wrote: Sounds like you need a union.
AFAIK C# doesn't provide it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
[bangs head against wall]
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Stored Procedure Code
ALTER PROCEDURE sp_IsValidLogon
@UserName varchar(16),
@Password varchar(16)
As
if exists(Select * From User_Table
Where UserName = @UserName
And
Password = @Password)
begin
return(1)
end
else
begin
INSERT INTO FailedLogons(UserName, Password)
values(@UserName, @Password)
return(0)
end
Go
How can i receive this return value in C#. Kindly, if any1 can give the code for it.
|
|
|
|
|
why are you not using output parameters in your stored procedure so that you cann access those values in c#
Gautham
|
|
|
|
|
I have wriiten the following code but not receiving the value, if u can kindly give me the code to receive the value from the ssotred procedure
SqlCommand("IsValidLogin",conn2);
cmd2.CommandType=CommandType.StoredProcedure;
cmd2.Parameters.Add(new SqlParameter("@userid",SqlDbType.NVarChar,50,"UserId"));
cmd2.Parameters.Add(new SqlParameter("@password",SqlDbType.NVarChar,50,"Password"));
cmd2.Parameters[0].Value=textBox1.Text;
cmd2.Parameters[1].Value=textBox2.Text;
i=cmd2.ExecuteNonQuery();
|
|
|
|
|
hi,
the code below is a modification of your code. it should work.
SqlCommand("IsValidLogin",conn2);
cmd2.CommandType=CommandType.StoredProcedure;
cmd2.Parameters.Add(new SqlParameter("@userid",SqlDbType.NVarChar,50,"UserId"));
cmd2.Parameters.Add(new SqlParameter("@password",SqlDbType.NVarChar,50,"Password"));
cmd2.Parameters[0].Value=textBox1.Text;
cmd2.Parameters[1].Value=textBox2.Text;
SqlParameter param = cmd.Parameters.Add("@retVal",SqlDbType.Int);<br />
param.Direction=ParameterDirection.Output;
i=cmd2.ExecuteNonQuery();
int retVal = cmd.Parameters["@retVal"].Value;
hope this helps
regards
|
|
|
|
|
it is not working bro.. there is an exception that too many parameters specified the stored procedure is taking only two values....how can we add the third one.. i just want to receive the return value whether it is 1 or it is 0 i just need to know how to receive it in my c# code.
|
|
|
|
|
hi again,
since you added a new parameter @retVal as output, you need to change the store procedure as well.
eg.
create proc sp_IsValidLogon<br />
(<br />
@UserName varchar(16),<br />
@Password varchar(16),<br />
@retVal bit --since you want only 0 or 1. this will store the return value<br />
As<br />
begin<br />
.........<br />
--continue with you proc<br />
set @retVal=1 --if you want 1, or else 0<br />
end
NOTE: if you use bit then change the parameter data type from int to bit in your source code.
hope this helps.
regards
|
|
|
|
|
Hi,Im new to C#,I would like to send a sms to a mobile from my C# application.Can any one help me by giving sample code...Thank You in advance..
Hi,Im Razana
|
|
|
|
|
|
I would like to know if is possible and if yes how to create an additional button on the title bar. (A forth button on the title bar)
like some programs have a Minimize to Tray, or for anything else.
<big>Example of the title bar: "." _ [] X</big>
This is not code :doh:
well in C#
Thank You
|
|
|
|
|
Yes it is possible, have a look at this article[^]
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
|
|
|
|
|
Thanks,
But is there a way that supports Visual Styles
or you have to create an image for the main themes(3) and depending on the current theme inserting the right one.
|
|
|
|
|
Have a look at this article[^]. It is vb.net code but I guess you would get something out of it
|
|
|
|
|
Hi,
I am having complex schema XSD file, i want to convert the XSD schema in to database table (oracle/sql server 2000) using vb/c# .net is it possible. If so can you plz guid me how to convert.
Thanks
Warm Regards
Prakash-B
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
1.Read the Schema in a dataSet
2.Loop thru the columns
3.While looping read the columns and datatypes and form a CREATE TABLE statement
4.Execute the statement thru Command object
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Hello,
So I am working on a project to transfer database data from different locations into one central database via webservices. My initial thought was to install the webservice on the database servers in the different locations and have the consumer webservice installed on the central database server invoke the webservices at each of these locations to update the central database. Now I don't know if that is the right way to do it as I have no clue as to how to differentiate between the webservices in these different locations and how to even call them. Please help. Suggestions and coments as to how I can go about this will be appreciated. Than you.
Nana
|
|
|
|
|
Don't Cross Post.
Regards,
Satips.
|
|
|
|
|
Thank you for your reply. The thing is I don't know what to do and I do not understand the cross post. Please explain further for me. thank you.
Nana
|
|
|
|
|
How can i load a program before windows logging in? adding a shortcut into a StartUp dirrectory did not help me
|
|
|
|
|
As a security measure, you cannot run programs before Windows login.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
MatrixCoder wrote: As a security measure, you cannot run programs before Windows login.
You can run programs before windows login. They are called Windows Services.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
You've asked this question before, gotten a bunch of answers, and chose to ignore them.
You're already been told - in order to run an application at Windows startup, you'd have to write it as a Windows Service.
|
|
|
|
|
You have to write a Windows service.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|