Posts

Showing posts from 2014

Search for a paritcular string in all Columns of all table of a Database.

Reference: http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm  --To search all columns of all tables in Pubs database for the keyword "Computer"   EXEC SearchAllTables 'Computer' GO Here is the complete stored procedure code: CREATE PROC SearchAllTables ( @SearchStr nvarchar(100) ) AS BEGIN -- Copyright © 2002 Narayana Vyas Kondreddi. All rights reserved. -- Purpose: To search all columns of all tables for a given search string -- Written by: Narayana Vyas Kondreddi -- Site: http://vyaskn.tripod.com -- Tested on: SQL Server 7.0 and SQL Server 2000 -- Date modified: 28th July 2002 22:50 GMT CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630)) SET NOCOUNT ON DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110) SET @TableName = '' SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''') WHILE @TableName IS NOT NULL BEGIN SET @Colum...

How to install asp.net4.5 in windows Server

Type the following command in cmd promt: dism /online /enable-feature /featurename:IIS-ASPNET45 /all

HOW TO configure HTTPS for a website in IIS7

Copied from: http://blogs.msdn.com/b/rakkimk/archive/2007/05/25/iis-7-how-to-configure-a-website-for-https.aspx The UI of the IIS manager in IIS 7 is completely different from that of IIS 6. Initially it will look as if you are going to use a brand new product which you are trying for the first time. But, if you are used to it, you will definitely appreciate the simplicity and easiness of configurations using IIS 7 manager. To setup a website for HTTPS, you will definitely need the following things (apart from some general network stuffs like opening the port, firewall rule, etc): 1.       Web Server Certificate 2.       SSL Port Getting a Web Server Certificate To get a web server certificate, in IIS 6 manager, you will go into website’s properties   à Directory Security and you will bring the Server Certificate wizard by clicking on the Server Certificate button under Secure communications. But, here in IIS 7, you can select t...

ASP.Net Custom session timeout

Image
Asp.net set session timeout in web.config, Global.asax and IIS Introduction: Here I will explain how to set session timeout in web.config,IIS and in application using asp.net manually. Description: By default our websites session timeout is 20 mins after that session will gets expire suppose if we want to set our custom timeout in our applications we can set it in different ways (web.config, global.asax and in IIS) Check below methods to set session timeout in web.config, global.asax and in iis In  Web.config  file we can set session timeout like as shown below  < configuration > < system.web >  < sessionState   mode = " InProc "   timeout = " 60 " >  </ sessionState >  </ system.web > </ configuration > In    Global.asax  file we can set session timeout in   Session_Start  event like this void   Session_Start( object   sender, ...

Paging, sorting and searching in mvc + razor

Image
Source: http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application The following illustration shows what the page will look like when you're done. The column headings are links that the user can click to sort by that column. Clicking a column heading repeatedly toggles between ascending and descending sort order. Add Column Sort Links to the Students Index Page To add sorting to the Student Index page, you'll change the   Index   method of the   Student   controller and add code to the   Student   Index view. Add Sorting Functionality to the Index Method In   Controllers\StudentController.cs , replace the   Index   method with the following code: public ActionResult Index ( string sortOrder ) { ViewBag . NameSortParm = String . IsNullOrEmpty ( sortOrder ) ? "Name_desc" : "" ; ViewBag . DateSortParm = sortOrder == "D...