Sunday, August 24, 2008
Lock and Unlock folder
Create a text file on the same path where your folder resides and write (e.g. if u want to lock folder on d:\ then create these files on d:\)
ren lockfolderName lockfolderName.{21EC2020-3AEA-1069-A2DD-08002B30309D}
then save this file with extension ".bat"
To unlock folder
Create a text file on the same path where your folder resides and write
ren lockfolderName.{21EC2020-3AEA-1069-A2DD-08002B30309D} lockfolderName
then save this file with extension ".bat"
Monday, June 2, 2008
Stored Procedure to Search Value in Database
set QUOTED_IDENTIFIER ON
go
ALTER PROC [dbo].[SearchAllTables]
(
@SearchStr nvarchar(100)
)
AS
BEGIN
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 @ColumnName = ''
SET @TableName =
(
SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName
AND OBJECTPROPERTY(
OBJECT_ID(
QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)
), 'IsMSShipped'
) = 0
)
WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)
BEGIN
SET @ColumnName =
(
SELECT MIN(QUOTENAME(COLUMN_NAME))
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = PARSENAME(@TableName, 2)
AND TABLE_NAME = PARSENAME(@TableName, 1)
AND DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
AND QUOTENAME(COLUMN_NAME) > @ColumnName
)
IF @ColumnName IS NOT NULL
BEGIN
INSERT INTO #Results
EXEC
(
'SELECT distinct ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + ', 3630)
FROM ' + @TableName + ' (NOLOCK) ' +
' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
)
END
END
END
SELECT ColumnName, ColumnValue FROM #Results
END
Monday, May 19, 2008
Thursday, April 10, 2008
Monday, March 17, 2008
Monday, March 3, 2008
create Virtual Directory using C#
Code to create Virtual Directory using C#
Private Sub CreateVirtualDir(ByVal WebSite As String, ByVal AppName As String, ByVal Path As String) Dim IISSchema As New System.DirectoryServices.DirectoryEntry("IIS://" & WebSite & "/Schema/AppIsolated") Dim CanCreate As Boolean = Not IISSchema.Properties("Syntax").Value.ToString.ToUpper() = "BOOLEAN" IISSchema.Dispose() If CanCreate Then Dim PathCreated As Boolean Try Dim IISAdmin As New System.DirectoryServices.DirectoryEntry("IIS://" & WebSite & "/W3SVC/1/Root") 'make sure folder exists If Not System.IO.Directory.Exists(Path) Then System.IO.Directory.CreateDirectory(Path) PathCreated = True End If 'If the virtual directory already exists then delete it For Each VD As System.DirectoryServices.DirectoryEntry In IISAdmin.Children If VD.Name = AppName Then IISAdmin.Invoke("Delete", New String() {VD.SchemaClassName, AppName}) IISAdmin.CommitChanges() Exit For End If Next VD 'Create and setup new virtual directory Dim VDir As System.DirectoryServices.DirectoryEntry = IISAdmin.Children.Add(AppName, "IIsWebVirtualDir") VDir.Properties("Path").Item(0) = Path VDir.Properties("AppFriendlyName").Item(0) = AppName VDir.Properties("EnableDirBrowsing").Item(0) = False VDir.Properties("AccessRead").Item(0) = True VDir.Properties("AccessExecute").Item(0) = True VDir.Properties("AccessWrite").Item(0) = False VDir.Properties("AccessScript").Item(0) = True VDir.Properties("AuthNTLM").Item(0) = True VDir.Properties("EnableDefaultDoc").Item(0) = True VDir.Properties("DefaultDoc").Item(0) = "default.htm,default.aspx,default.asp" VDir.Properties("AspEnableParentPaths").Item(0) = True VDir.CommitChanges() 'the following are acceptable params 'INPROC = 0 'OUTPROC = 1 'POOLED = 2 VDir.Invoke("AppCreate", 1) Catch Ex As Exception If PathCreated Then System.IO.Directory.Delete(Path) End If Throw Ex End Try End If End Sub
Friday, February 29, 2008
Tuesday, February 26, 2008
Microsoft .Net Collection
Monday, February 25, 2008
Friday, February 22, 2008
For C# related queries:
http://www.java2s.com/Code/CSharp/CatalogCSharp.htm
For Windows Update:
http://update.microsoft.com/windowsupdate/v6/default.aspx
http://darpg-grievance.nic.in/
--Link to get books online:- http://www.ebooksportal.org/
---Sort Using DAO http://search.technet.microsoft.com/search/default.aspx?siteId=1&tab=0&query=sort+property+of+DAO
http://www.workopia.com/Links.htm
To download E Books:
http://www.toebook.com/5-dfbe74899836f260.htm
For downloading .Net Framework.
http://msdn2.microsoft.com/en-us/netframework/aa569263.aspx
For Online Microsoft Product Information
For Online Books
ftp://ftp.uar.net/pub/e-books/
To watch movies online:
http://mydigitalshare.com/modules/myvideos/viewcat.php?cid=1&min=50&orderby=titleA&show=50
http://www.irani-chai.com/movies-online/english-movies/the-matrix-revolutions-english-movie-2003.html
http://www.irani-chai.com/movies-online/telugu-movies/boys-telugu-movie-2003.html
http://bollybuz.blogspot.com/2007/09/download-saawariya-movies-songs-music.html
To Get Free WebSiteTemplate
http://www.freelayouts.com/websites/html-templates?order=reviewed_on+desc
http://www.mastertemplates.com/download/free-template-087.htm
For Microsoft Certifications Dumps
http://www.btebook.com/
http://www.toebook.com/%7B38130391-2838-4E55-B465-150EE7C2234C%7D.htm for Sharepoint
http://www.zmag.dk/showmag.php?mid=wppfp--- Microsoft Dynamics CRM book
http://www.workopia.com/Links.htm#Books--- Microsoft Dynamics CRM book
http://www.datadirect.com/developer/net/useful_links/index.ssp