Wednesday, March 26, 2014

Access modifiers

public
The type or member can be accessed by any other code in the same assembly or another assembly that references it.
private
The type or member can only be accessed by code in the same class or struct.
protected
The type or member can only be accessed by code in the same class or struct, or in a derived class.
internal
The type or member can be accessed by any code in the same assembly, but not from another assembly.
protected internal
The type or member can be accessed by any code in the same assembly, or by any derived class in another assembly.

Friday, February 28, 2014

Entity framework in WCF Service - Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool.



Incase if you getting the "Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool." while using the Entity framework WCF service required MSDTC follow the below steps,
 

To find that,
1. go to start -> run -> type "c:\Windows\System32\comexp.msc" or comexp.msc
2. Click Component Services
3. Click Computers. Under this, click "My Computer"
4. Once you open "My Computer" you will see 4 folders.
5. Click on Distributed Transaction Coordinator. Underneath this, you will see "Local DTC'
6. Right click "Local DTC" and go to properties.
7. Select Security Tab.
8. Check mark "Network DTC Access" checkbox
9. Finally check mark "Allow Inbound" and "Allow Outbound" checkboxes.
10. Click Apply, Ok.
11. A message will pop up about restarting the service.
12. Click ok and That's all.

Saturday, May 14, 2011

Forgot SQL Server Admin Password

exec sp_password @new='NewPassword', @loginame='sa'
go
alter login sa enable
go

Saturday, August 7, 2010

Bend Replacement for Traditional notepad ?

Notepad is the light-weight text editor for Windows OS for a long time with simple UI and limited functionalities. I had a chance to try bend for few minutes and I am convinced with its functionalities.

Bend have all the functionalities available in the notepad, and also having tab interface, better find and replace, Zoom Ctrl + Mouse Wheel, Syntax highlighting etc.

Its Prerequisites,

Note :Apparently Bend works on Vista and XP SP3 as well. As long as .net 4.0 works

Courtesy:Codeplex

Monday, February 1, 2010

How To Zip The Folder using VB script

Option Explicit

Const FOF_SIMPLEPROGRESS = 256
Dim MySource, MyTarget, MyHex, MyBinary, i
Dim oShell, oCTF
Dim oFileSys
dim winShell
Const cstrApp = "Zip It"
MySource = InputBox("Enter path to folder to zip (Ex:D:\xyzfolder)", cstrApp ) 'Example :"D:\test\"
MyTarget = InputBox("Enter path and name of Zip file (Ex:D:\xyz.zip)", cstrApp)'"D:\smp.zip"

MyHex = Array(80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0)

For i = 0 To UBound(MyHex)
MyBinary = MyBinary & Chr(MyHex(i))
Next

Set oShell = CreateObject("WScript.Shell")
Set oFileSys = CreateObject("Scripting.FileSystemObject")

'Create the basis of a zip file.
Set oCTF = oFileSys.CreateTextFile(MyTarget, True)
oCTF.Write MyBinary
oCTF.Close
Set oCTF = Nothing

'Add File to zip
set winShell = createObject("shell.application")
winShell.namespace(MyTarget).CopyHere MySource

wScript.Sleep(5000)

'Follow these steps only if you're receiving the 800A01AD error for Wscript.Shell component. For any other ActiveX object, the following steps does not apply:
'Click Start, Run and type:
' * regsvr32 wshom.ocx
' * regsvr32 scrrun.dll