|
CREATE PROC FindEmployee
@RefNo VARCHAR(100) = NULL,
@EmpId INT = NULL
AS
IF @RefNo IS NOT NULL
SELECT * FROM Employees WHEERE RefNo = @RefNo
ELSE
SELECT * FROM Employees WHEERE EmpId = @EmpId
EXEC FindEmployee @RefNo = 'ABC123'<br />
EXEC FindEmployee @EmpId = 999
By specifying a default for each param in the SP (the = NULL bit) you do not have to pass that parameter to the stored procedure. Therefore by checking the default ( IS NOT NULL bit) you can determine which param was passed in. It should be obvious from the code above that if both are passed in it still uses @RefNo - this could be switched around to favour EmpId.
|
|
|
|
|
Hi, this might be a stupid question, but I don't know how to do it, and I need help...
I need to find out how to make one web-site controlled by more than one moderators.
I mean, for example, when one moderator is on-line and working on some profile to approve it (for example how moderator of forum work), another moderator should work on another profile. So, I don't know how to distribute the moderators job. And the number of moderators is growing.
thanks..
|
|
|
|
|
For something like this i'd probably use a local message queue on the server. This then sits there, allowing things to be popped off it, and new stuff added to the other end....
Do a goole for MSMQ (Microsoft Message Queueing)....
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hi,
I have created a Webusercontrol named sample.ascx.
I Have to dynamically load the usercontrol in my Webform.
The usercontrol has textbox control named Usernametxt,label control named UsernameLbl and a button control named Loginbtn
The following is the code i used in the pageload of my Webform,
protected void Page_Load(object sender, EventArgs e)
{
WebUserControl c;
c = LoadControl("WebUserControl.ascx") as WebUserControl;
if (c != null)
{
Controls.Add(c);
}
}
I get the following error:
Control 'ctl02_Usernametxt' of type 'TextBox' must be placed inside a form tag with runat=server.
Can ne body help me fixing the bug
zari
|
|
|
|
|
Hi zari,
the textbox (and all other input controls) must be embedded into a form. Only a form can post the user input to the server. You need something like that.
<form id="form1" runat="server"><br />
<!-- place your controls here --><br />
</form>
I think, that you already have this form-Tag in your page. Just change the line "Controls.Add(c);" to
"Form.Controls.Add(c);".
Tom
|
|
|
|
|
Hi my dears,
I have several UpdatePanels in my page . and in one of them I used a PalceHolder to add some controls to it in run time . everything is good and when my page loads controls will be added to PlaceHolder but when I click any other controls in other UpdatePanels in my page the PlaceHolder loses its controls.
pls help me know what to do ?
Thx a lot,
www.behzadi.net
|
|
|
|
|
Hello everyone,
well I'm trying to populate a DropDownList from a Selfjoined table. At first I was using a treeView but now they say the want a dropDownlist for that. I'm having touble in showing the tree like structure in the combo box
Can you plz give some guidlines or code samples for that
Thanks in advance
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
im getting error as
im trying to create crystal report where data is coming to dataset from query(select *from emp) and but when binding reportdocument to dataset it is giving error as below:
CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Invalid report file path.
Thanx is advance
|
|
|
|
|
I want to get list of asp.net controls and list them in a listbox. I know they are all in WebControl namespace but there so many extra class are also there. So anybody know some smooth solution?
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
which type of controls u want?
mention it clearly...
|
|
|
|
|
Standard Controls, Data Controls, Validation Control, Login Controls
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
Hi i m again i had made a Stored procedure which return a table of two Column in which there 700 record i want to show the record in the Crystal report int in 2 Four Column Like Half og the record should be shown in First two and remaining in last two Coulmn what i shell doo
wasim khan
|
|
|
|
|
What is the smallest unit of execution in .NET?
Is XML case-sensitive
modified on Tuesday, December 11, 2007 3:55:05 AM
|
|
|
|
|
Assembly?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hello Friend,
Assembly is the smallest unit in .NET to execute.
But can u explain it wht it is
|
|
|
|
|
Vasudevan Deepak K wrote: Assembly?
Define "assembly"
Did you mean a DLL or EXE? If so, isn't that the largest unit of execution?
|
|
|
|
|
I guess the smallest unit of execution is a property, because they tend to be smaller than methods. Is this what you meant ?
Does Google say that XML is case sensitive ? Have your experiments with XML indicated that it's case sensitive ?
It is, but you shouldn't need to ask here to find that out.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sir r u sure smallest unit of execution is property not Assembly as i got in last reply
|
|
|
|
|
The Knowledge wrote: Sir r u sure smallest unit of execution is property not Assembly as i got in last reply
How do you know the previous reply was correct? What makes you doubt Christian?
|
|
|
|
|
The Knowledge wrote: What is the smallest unit of execution in .NET?
What do you mean by smallest unit of execution? .NET languages comile in to CIL (aka MSIL). Each CIL instruction could be considered the smallest unit of execution.
|
|
|
|
|
Homework questions much?
Now that you've had 3 pretty good answers which one are you going to submit? Have you considered checking back in your course notes to see which one of these your teacher thinks is the right answer?
|
|
|
|
|
Now i'm very confused because i've 3 good answers
But still i don't know which i must go with.
|
|
|
|
|
The Knowledge wrote: Now i'm very confused
Therein lies the problem of having not listened in class and expecting an answer from the internet to be definitive.
|
|
|
|
|
Hi,
I am trying to split a class(Class1) to different files, hence i have changed the access specifier for the Class1 to Partial. I have created one more class with the same name(Class1) and same namespace. From the second class file which i created, i am able to access the procedures / functions from the first class file, but i am not able to access the variables which are used there.
Can anyone help me to access the variables from the first class file.
Regards
N.Surendra Prasad
|
|
|
|
|
That's just not possible. If you have a partial class, properly declared, then the variables and methods are all together in the one class.
Having said that, when I do a partial class, I tend to make it so that variables are used in methods in the same file. That just makes sense of the whole concept
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|