tag:blogger.com,1999:blog-6082652835152798567.post5745593755421300101..comments2024-03-28T21:41:58.974-07:00Comments on Sql server, .net and c# video tutorial: Part 68 - Optional parameters in sql server stored proceduresUnknownnoreply@blogger.comBlogger6125tag:blogger.com,1999:blog-6082652835152798567.post-71547936654777896732020-12-31T19:45:28.246-08:002020-12-31T19:45:28.246-08:00When I try to run the ASP.NET program, I get:
HT...When I try to run the ASP.NET program, I get: <br />HTTP Error 403.14 - Forbidden<br />The Web server is configured to not list the contents of this directory.<br />Most likely causes:<br /><br /> A default document is not configured for the requested URL, and directory browsing is not enabled on the server.<br /><br />How do you enable directory browsing?<br />smhikerhttps://www.blogger.com/profile/11627769387731977744noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-61942460061081916032018-12-17T00:10:13.508-08:002018-12-17T00:10:13.508-08:00I'm having a doubt that if we are passing null...I'm having a doubt that if we are passing null in where clause then how it's returning all the results?Anonymoushttps://www.blogger.com/profile/09434484123535460719noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-45225498127460755622016-10-29T20:16:47.939-07:002016-10-29T20:16:47.939-07:00Create Proc spSearchEmployees
@Name nvarchar(50),
...Create Proc spSearchEmployees<br />@Name nvarchar(50),<br />@Email nvarchar(50),<br />@Age int,<br />@Gender nvarchar(50)<br />as<br />Begin<br />Select * from tblEmployee where<br />Name=ISNULL(@Name,Name) <br />AND Email=ISNULL(@Email ,Email)<br />AND Age =ISNULL(@Age ,Age )<br />AND Gender =ISNULL(@Gender,Gender) <br />End<br /><br />--CALLING SP<br />exec spSearchEmployees NULL, NULL, NULL, NULL<br /><br />without optional parameters also it works<br /><br />what is the difference?Anonymoushttps://www.blogger.com/profile/03525592385341253603noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-91606318383491374922016-06-21T01:07:37.068-07:002016-06-21T01:07:37.068-07:00Hi, how to use optional where clause if it has Dat...Hi, how to use optional where clause if it has Date range "Between" clause??Anonymoushttps://www.blogger.com/profile/16827886562589542198noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-69197778385145618572016-03-22T05:27:29.212-07:002016-03-22T05:27:29.212-07:00Thank you sir for such a good article. I have the ...Thank you sir for such a good article. I have the same kind of work and came across one problem. It is a cascaded drop down list like country, state and city. The app works fine for name, age and country search with and without values but not for state and city. I could not figure out the problem. Any solution?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-81389477579745666342016-01-05T04:44:58.655-08:002016-01-05T04:44:58.655-08:00Create Proc spSearchEmployees
@Name nvarchar(50) =...Create Proc spSearchEmployees<br />@Name nvarchar(50) = NULL,<br />@Email nvarchar(50) = NULL,<br />@Age int = NULL,<br />@Gender nvarchar(50) = NULL<br />as<br />Begin<br /> Select * from tblEmployee where<br /> Name=ISNULL(@Name,Name) <br />AND Email=ISNULL(@Email ,Email)<br />AND Age =ISNULL(@Age ,Age )<br />AND Gender =ISNULL(@Gender,Gender) <br />End<br /><br />or You can replace isnull by coalesce its work same<br />but personally i use isnull for better performance ANAND SAXENA (CS)https://www.blogger.com/profile/05672566473736791251noreply@blogger.com