Amir Mirkamali

امیر میرکمالی

What is the Differnce between wsdl and asmx?

You use an *.asmx file to create an ASP.NET Web Service.  This file contains your service implementation and is needed for hosting the service.

ASP.NET automatically generates the WSDL or "service description" for your service by reflecting over the types in your service.  You can see the WSDL for your service by browsing to your ASMX file, which should show you a help page for your service containing a link to the service description for the service.  The WSDL can also generally be reached by appending "?wsdl" to the address of the asmx file.


C# DateTime.MinValue is not the same as SqlDateTime.MinValue

DateTime myDate = DateTime.MinValue; //=> 1/1/0001
SqlDateTime mySqlDate = SqlDateTime.MinValue; //=> 1/1/1753
//Note that SQL Server's smalldatetime min value is 1/1/1900

Which Content-Type you must set for binary stream, to download when using Response.Binarywrite

Response.ContentType = "application/force-download";

Response.AddHeader("Content-Disposition", "attachment;filename=\"" + Filename + "\"");



Shrink Database log file in SQL Server

if you want to shrink database log file just run this codes with your database name:

DBCC SHRINKFILE(yourdbname_log, 2)

this code will shrink and reduce your database log file to 2MB


in sql server 2008 above code not work and you must use this code

USE yourdbname;

 ALTER DATABASE yourdbname
 DBCC SHRINKFILE (yourdbname_log, 10);
 ALTER DATABASE yourdbname

WPF Browser Application VS ASP.Net

A WPF browser project is the same as writing a java applet/application, only you use IE and .net instead. you would do it for the same reasons you would write a java application.

The main wpf cons are:

  1. User must have .net installed, and use IE to access the app.
  2. Slow load time (.net vm must be loaded and app jit'd)

the main wpf pros:

  1. Rich UI (winforms)
  2. Coding understood by windows programers

the main cons:

  1. Programmer must learn web model
  2. Somewhat limited UI
  3. Cross browser testing required

the main pros:

  1. Cross browser compatiability (universal access)

Recreate Show Desktop Shortcut

Copy and paste the following lines into a Notepad file.


Rename it to desktop.scf

Reinstall Visual Studio 2003 Remote debugger

Run  RemoteComponents.hta from your installation cds. navigate and find "install full remote debugging on all operating systems" and push the install full button. I had to many probems with my remote debugger and this solved my problem.

this link was very usefull to understand what is my debugger problem: