Implement search web page using ASP NET and Stored Procedure HD

31.03.2017
Text version of the video http://csharp-video-tutorials.blogspot.com/2017/03/implement-search-web-page-using-aspnet.html Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help. https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1 Slides http://csharp-video-tutorials.blogspot.com/2017/03/implement-search-web-page-using-aspnet_30.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All SQL Server Tutorial Videos https://www.youtube.com/playlist?list=PL08903FB7ACA1C2FB All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this video we will discuss implementing a search web page using ASP.NET and Stored Procedure. Step 1 : Modify the "spSearchEmployees" stored procedure to include NULL as the default value for the parameters. The advantage of specifying default value for the parameters is that the ASP.NET page need not pass those parameters when calling the stored procedures if the user did not specify any values for the corresponding search fields on the Search Page. Alter Procedure spSearchEmployees @FirstName nvarchar(100) = NULL, @LastName nvarchar(100) = NULL, @Gender nvarchar(50) = NULL, @Salary int = NULL As Begin Select * from Employees where (FirstName = @FirstName OR @FirstName IS NULL) AND (LastName = @LastName OR @LastName IS NULL) AND (Gender = @Gender OR @Gender IS NULL) AND (Salary = @Salary OR @Salary IS NULL) End Go Step 2 : Create a new empty ASP.NET Web Forms application. Name it "DynamicSQLDemo". Step 3 : Add a connection string to your database in web.config. For the connection string please check my blog at the following link http://csharp-video-tutorials.blogspot.com/2017/03/implement-search-web-page-using-aspnet.html Step 4 : Add a WebForm to the project. Name it "SearchPageWithoutDynamicSQL.aspx" Step 5 : Copy and paste the HTML on my blog at the following link on the ASPX page. Notice we are using Bootstrap to style the page. If you are new to Bootstrap, please check out our Bootstrap tutorial for beginners playlist. Step 6 : Copy and paste the following code in the code-behind page. Notice we are using the stored procedure "spSearchEmployees". We are not using any dynamic SQL in this example. In our next video, we will discuss implementing the same "Search Page" using dynamic sql and understand the difference between using dynamic sql and stored procedure. using System; using System.Configuration; using System.Data; using System.Data.SqlClient; namespace DynamicSQLDemo { public partial class SearchPageWithoutDynamicSQL : S

Похожие видео

Показать еще