|
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.
|
|
|
|
|
When creating a shortcutkey, an error occurs with single keys like ‘f’ or ‘w’ , etc. I don’t have a problem with not using these but I can’t find any rules. Is there a list on valid shortcut keys?
Thanks
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
Because you must select a combo (e.g. Ctrl+F or Ctrl+Alt+W), not a single key. Single keys will interfere with standard functions within your application, like typing.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Im using something called syntax high lighting textbox library in one of my project. To be able to easily highlight syntax, i wrote this lil code:
<br />
TextReader syntax_blue = new StreamReader("synHighLib_DB/blue.txt");<br />
while (syntax_blue.ReadLine() != null)<br />
{<br />
shtb.HighlightDescriptors.Add(new HighlightDescriptor(syntax_blue.ReadLine(), Color.Blue, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true));<br />
}<br />
syntax_blue.Close();
It compiles properly, but when i start typing into the text box, i get the unhandled exception error. Im 100% sure this is the code that causing the error, because, when i remove it, it works fine...
|
|
|
|
|
Posting the exception you're receiving would be very helpful, but it looks like you're calling ReadLine twice without any assurance that you have two (or a multiple of two) lines to read. Readline is going to advance the cursor each time it's called.
Additionally, if the code above is inside an error handler, I would point out that it might not be the best choice to open and parse a text file every time a key is pressed.
Finally, a TextReader is a disposable type, so I would recommend either inserting a Try...Finally block or, better, a using (TextReader syntax_blue = ...) block instead.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
I need to obtain all of the bookmarks within a Word document using late binding. I have easily done this using early binding. However, I am having some trouble with the former. I know how to open and write to a file. I have the framework developed. Any help on returning the collection of bookmarks using this method would be much appreciated.
Thanks
P
|
|
|
|
|
I'm trying to use the FolderNameEditor in a property grid. Like this:
[Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
But it seems that FolderNameEditor is not in that namespace. Although all the documentation that I've seen says that it is. I'm using VS2005 and the 2.0 framework.
Can someone tell me where this editor is?
|
|
|
|