Friday, 30 December 2011

How i Can Receive my Server Current Time.

"Now" Property give you current Date Time give you a current Server Time
Syntax:
DateTime dt = DateTime.Now; 

how i can close C# Application.

For Exit Your Project You Can Use Exit Method.

Application.Exit();

how i can pass command line argument on my C# application.

1. Right Click on Your Project.


2.Select The Property Option Last in Popup Menu.


3 Select Debug Option Left Side 4th option on your Screen.


4. Then Type Your Command Line Arguments on the Field Like Ganesh.

Thursday, 15 December 2011

How To Get All Data Base Name in SQL Server

Get All Data Base Name 

Select * From sys.databases


Create Setup File of c# program


his step by step tutorial guides you towards how to create a setp for a Windows Forms application using Visual Studio 2005.

Step 1: First of all, create a Windows Forms application. 

Step 2: Next add a setup project by clicking on File-> Add-> New Project.

By clicking here the window will open like this:



Figure 1:

Step 3: Select here Setup and Deployment in the left side bar in project types.



Figure 2:

Here we find three options as following:
  1. Application Folder
  2. User's Desktop
  3. User's Program Menu
Step 4: These three options are the three places where we want to copy our setup fules during the installation process. From here we have to select one option. Suppose I select User's Desktop. Then Right click on User's Desktop option and select Add-> Project Output. The window will look like as.



Figure 3:

Step 5: After clicking on Project Output, a new window will open. Here we select first four options. Now click on OK.



Figure 4:

Step 6: After clicking on OK, Rebuild the Setup from Build option in Menu bar like as.



Figure 5:

Step 7: After this, let's test our setup by going right clicing on the setup project in Solution Explorer and click on Install menu item. 



Figure 6:

The setup process will start, which looks like this: 



Figure 7:

Step 8: After copmpleting the installation go on desktop there you will find all files you have included in the setup on the desktop.

Saturday, 10 December 2011

How to i Can Create Backup and Restore my File With LowDisk Space


BACKUP DATABASE DataBase
TO DISK='D:\checking\DataBase_1.bak',
DISK='D:\checking\DataBase_2.bak'
GO



RESTORE DATABASE DataBase1
FROM DISK='D:\checking\DataBase_1.bak',
DISK='D:\checking\DataBase_2.bak'
WITH MOVE 'LogicalNameofDB_Mdf' TO 'D:\DataBackup\DataBase.mdf',
MOVE 'LogicalNameofDB_Log' TO 'D:\DataBackup\DataBase.ldf'
GO

Monday, 26 September 2011