Microsoft SQL Server Database Publishing Wizard 1.1

January 31, 2008

Hello ,

Microsoft SQL Server Database Publishing Wizard enables you to Generate Script of SQL Server Database with the following features:

1)Creating Data Only , Schema Only or Schema & Data Script.

2)Building Script for specific objects.

3)Compatible with SQL Server 2000 and SQL Server 2005 servers.

4)Two scripting modes :

a)Scripting to a file .

b)Publishing to shared hosting provider.

5)Integrating into Visual Studio 2005 and/or Visual Web Developer 2005.

Download Microsoft SQL Server Database Publishing Wizard 1.1

Advertisements

BUG : Unable to update the dependencies of the project.

January 28, 2008

Hello ,

Yesterday , When building the setup project , I received the following error :

“Unable to update the dependencies of the project. The dependencies for the object ‘ name.dll ‘ cannot be determined..”

Also trying to Refresh Dependencies was not successful :

“The operation can not be completed.”

This problem occurs when .VDPROJ file is corrupted , to resolve this bug , you may follow these steps :

1) Open .VDPROJ file with a text editor :

2)Find “Hierarchy” & “File” Sections and Delete everything in them ,

3)Delete “Project Primary Output” And Add it again.

4)Reload the project .

5)Rebuild the project.

If the above solution did not work , you may need to DELETE the setup project and create it from the scratch.

Note : This BUG occured on a machine having Visual Studio 2005 Team Suite Edition with SP1 Installed .

This BUG is reported here :

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=119625

Microsoft has also published a hotfix that can be found here :

FIX: The Visual Studio 2005 IDE may corrupt the deployment files for a Web Setup Project and for a Setup Project

In this article , the author mentined that :

“This problem may occur when you have a Database Project and a Setup Project in the same solution”

But Keep in mind that this problem may occur even if the solution does not contain any Database Project , So the above quotation is not the accurate cause of the issue.


Microsoft Adds Persian Collation to SQL Server 2008

January 20, 2008

Hello ,

I appreciate Mr.Amin Sobati for requesting Microsoft to add persian collation to SQL Server 2008 and Now It’s accepted!

All Iranian Programmers and Developers would be glad to know that they no longer have any problem with persian support in SQL Server in the near future and are able to take the most advantage of SQL Server enhancements.

Visit the following Microsoft Connect Page :

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=284192


Test-Driven Development

January 20, 2008

Hello ,

Being a professional software developer , you’ve certainly heard about TDD(Test-Driven Development) . TDD is a software development method which states that test-cases are provided before adding or enhancing a feature. What’s the merit? Writing test-cases prior to developing a functionality helps you evaluate the result after any change. The written test will doubtlessly fail and you write code to overcome it. In my opinion , you are advised to work on this modern technique and take the most advantage of that .

For Further Info:

Your Test-Driven Developenet Community

http://c2.com/cgi/wiki?TestDrivenDevelopment


Max Pool Size Was Reached!

January 19, 2008

Hello ,
When dealing with ADO.Net , You might receive the following exception:

System.InvalidOperationException: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.

Now, I’m going to elaborate on this issue:
1) This exception may occur if you open 100 connections to database and do not Close or Dispose them, For producing this exception, you may write a loop from 1 to 100 and open a connection to database each time and leave it open, You will get the mentioned exception.
2) Another possible reason is that When SQL Server Debugging is turned on, you open and close connections quickly and this causes the exception. For getting information on how to work around this, you may visit http://support.microsoft.com/kb/830118
Note: This Applies to Visual Studio.Net 2003.
3) Another point is that when using SqlConnection , You do not Close or Dispose it and leave it open , Lets get into this reason with an example :

  SqlConnection sqlConn = new SqlConnection("Data Source=DotNetPC;Initial Catalog=DppcDB;Integrated Security=True");
  sqlConn.Open();
  SqlCommand sqlCmd = new SqlCommand();
  sqlCmd.Connection = sqlConn;
  sqlCmd.CommandType = CommandType.Text;
  sqlCmd.CommandText = "select * from Management.Logs";
  sqlCmd.ExecuteNonQuery(); // Connection will remain open

above code is not acceptable and may lead to the exception , You may use one of the following code styles:
1) Implementing ‘using’ keyword as shown below:

using (SqlConnection sqlConn = new SqlConnection("Data Source=DotNetPC;Initial Catalog=DppcDB;Integrated Security=True"))
{
sqlConn.Open();
SqlCommand sqlCmd = new SqlCommand();
sqlCmd.Connection = sqlConn;
sqlCmd.CommandType = CommandType.Text;
sqlCmd.CommandText = "select * from Management.Logs";
sqlCmd.ExecuteNonQuery();
} // It ensures that connection will close & dispose

2) Putting Try—Catch—Finally Block into work :

SqlConnection sqlConn = new SqlConnection("Data Source=DotNetPC;Initial Catalog=DppcDB;Integrated Security=True");
try
{
sqlConn.Open();
SqlCommand sqlCmd = new SqlCommand();
sqlCmd.Connection = sqlConn;
sqlCmd.CommandType = CommandType.Text;
sqlCmd.CommandText = "select * from Management.Logs";
sqlCmd.ExecuteNonQuery();
}
catch (Exception)
{
//Do Something
}
finally
{
//'finally' block is ALWAYS get called.
sqlConn.Close();
sqlConn.Dispose();
}

What is the different between Close and Dispose?
The only difference is that ‘Dispose’ method clears the connection string and pool group and then calls the ‘Close’ method.
I’ve used Reflector to prove this:

public override void Close()
{
IntPtr ptr;
Bid.ScopeEnter(out ptr, " %d#", this.ObjectID);
try
{
SqlStatistics statistics = null;
RuntimeHelpers.PrepareConstrainedRegions();
try
{
statistics = SqlStatistics.StartTimer(this.Statistics);
lock (this.InnerConnection)
{
this.InnerConnection.CloseConnection(this, this.ConnectionFactory);
}
if (this.Statistics != null)
{
ADP.TimerCurrent(out this._statistics._closeTimestamp);
}
}
catch (OutOfMemoryException exception3)
{
this.Abort(exception3);
throw;
}
catch (StackOverflowException exception2)
{
this.Abort(exception2);
throw;
}
catch (ThreadAbortException exception)
{
this.Abort(exception);
throw;
}
finally
{
SqlStatistics.StopTimer(statistics);
}
}
finally
{
SqlDebugContext context = this._sdc;
this._sdc = null;
Bid.ScopeLeave(ref ptr);
if (context != null)
{
context.Dispose();
}
}
}

protected override void Dispose(bool disposing)
{
if (disposing)
{
//Clears the connection string and pool group.
this._userConnectionOptions = null;
this._poolGroup = null;
//Calls the close method.
this.Close();
}
this.DisposeMe(disposing);
base.Dispose(disposing);
}

Of course , you may increase the Connect Timeout or Max Pool Size in connection string , but you are advised to looking for problem at first.I’m
Looking forward to your extra information.


.Net Framework Source Code is Now in Your Hands!

January 17, 2008

Hello ,

Last October , ScottGu announced that Microsoft is going to release Source Code for .Net Framework Class Libraries , Now It’s Available!

Right Now , you can browse and debug following .Net Framework Libraries with Visual Studio 2008 :

  • .NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading, etc).
  • ASP.NET (System.Web, System.Web.Extensions)
  • Windows Forms (System.Windows.Forms)
  • Windows Presentation Foundation (System.Windows)
  • ADO.NET and XML (System.Data and System.Xml)

And they are going to provide source code for Windows Communication Foundation , Windows Workflow Foundation and LINQ in near future .


This helps programmers having a deeper perception of .Net Framework Class Libraries and understanding how thease libraries are implemented in order to build stronger Windows & Web Applications.

 Visit the following links for further information :

ScottGu’s Blog

Configuring Visual Studio to Debug .NET Framework Source Code
 


First Post

January 17, 2008

Hello ,

Microsoft Technologies are becoming widespread among developers and programmers. Thease new enhancements have revolutionized the process of developing softwares and web applications. Emersion of .Net technology and introducing new concepts made many professionals concenterate on the innovative solutions and implement them.

In this blog , I’m going to put forward ideas , experiences and problems which .Net programmers encounter them and would appreciate practical solutions to help each other improve.

We Exist To Help Each Other!