Sql Server Management Studio ( SSMS ) – Query Results – Max Column Length

Background

Ran a query that gives me the most expensive queries.

As I try to capture the SQL Column I am finding out that the results is chopped off.

 

TroubleShooting

SQL Server Management Studio

Query Results

Access the Options Menu and transversed to Query Results \ SQL Server \ Results to Grid

resultstogrid

And, determine the max Non XML data is 65535 Characters.

 

What is Column Length?

Changed the query to emit the column length…

statementlength

Explanation

  1. Our most expensive query is 147,020 characters
  2. Some other queries are 16,736 and another is 11,133

 

StackOverflow

Googled for a fix and as always found one via Stackoverflow.

Link

Copy Current Cell

stackoverflow_question-11897950

Visualize

stackoverflow_question-11897950_visualize

 

SSMSBoost

Journeyed to SSMS Boost web site here

Available Binaries

Downloaded version Specific

download

Download & Install

Downloaded and Installed SSMS Boost

 

License

Retrieve User/machine Has Token

Retrieved User/Machine Token through running SSMS and accessing menu items SSMSBoost / About License.

ssmsboost-aboutlicense-croppedup

 

Request Community License

Requested Community License by going here.

requestingfreelicense-cropped-up

Here is the Free License Request Form that comes up.

requestlicense-cropped

 

Received License

Received license over email

 

Applied License

 

Usage

Ran the query again.

Grid

copycurrentcell1to1-cropped-up

 

Select Grid Cell

Selected the Grid Cell and right clicked on our selection.

Chose “Copy current cell 1:1” from the dropdown menu.

We were able to capture our cell’s content.

 

Editor

NotePad++

Was able to paste into Notepad++.

Contents

notepadplusplus-summary

Summary

In Notepad++, accessed the menu item View \ Summary.

Here is what our summary window looks like:

notepadplusplus-summary-20170216-0604pm

Explanation:

We have about over 43 thousand characters.

 

Dedicated

Dedicated to SSMSBoost’s directory Andrei Rantsevich.

 

Summary

From the Query’s contents:

(@p__linq__0 datetime2(7),@p__linq__1 datetime2(7),@p__linq__2 bit,@p__linq__3 uniqueidentifier,@p__linq__6 bit,@p__linq__4 uniqueidentifier,@p__linq__5 bit)SELECT
[Project40].[Id] AS [Id],
[Project40].[C1] AS [C1],
[Project40].[Id2] AS [Id1],
[Project40].[Id5] AS [Id2],
[Project40].[Id1] AS [Id3]

we can see that the query is not handwritten, but generated via Microsoft .Net Linq.

Simple .Net ASPX/DB Sample

Objective

Needed a sample C# code to track .Net Application and its interaction with the database.

 

Files

  1. Database
    • MS SQL Server
      • Stored Procedure dbo.TimeDelay_hh_mm_ss;
  2. .Net
    • Web.config
    • testDB.aspx
    • testDB.cs

 

Stored Procedure dbo.TimeDelay_hh_mm_ss;

Stolen from WAITFOR (Transact-SQL) ( link )


IF OBJECT_ID('dbo.TimeDelay_hh_mm_ss','P') IS NOT NULL  
    DROP PROCEDURE dbo.TimeDelay_hh_mm_ss;  
GO  
CREATE PROCEDURE dbo.TimeDelay_hh_mm_ss   
    (  
    @DelayLength char(8)= '00:00:00'  
    )  
AS  
DECLARE @ReturnInfo varchar(255)  
IF ISDATE('2000-01-01 ' + @DelayLength + '.000') = 0  
    BEGIN  
        SELECT @ReturnInfo = 'Invalid time ' + @DelayLength   
        + ',hh:mm:ss, submitted.';  
        -- This PRINT statement is for testing, not use in production.  
        PRINT @ReturnInfo   
        RETURN(1)  
    END  
BEGIN  
    WAITFOR DELAY @DelayLength  
    SELECT @ReturnInfo = 'A total time of ' + @DelayLength + ',   
        hh:mm:ss, has elapsed! Your time is up.'  
    -- This PRINT statement is for testing, not use in production.  
    PRINT @ReturnInfo;  
END;  
GO  

Web.config


<!--l version="1.0"-->

<configuration>
	
	<connectionStrings>

		<clear />
	 
		<add name="dbConn" connectionString="Server=DBDEV;Database=DBLAB;Trusted_Connection=Yes;" >

		</add>
		
	</connectionStrings>

	
</configuration>

testDB.aspx



<%@ Page language="c#" Codefile="testDB.cs" AutoEventWireup="true" Inherits="_Default" Debug="true" %>

<title>
Simple
</title>


<form id="form1" runat="server">


<div>

		<asp:button id="btnTestDb" onclick="btnTestDbClick" runat="server" text="Test Database Connection" />
		
		</BR>
		&nbsp;&nbsp;
		
		Timeout (HH:MM:SS)
		<asp:TextBox runat="server" ID="txtTimeoutValue" text="00:01:00" >
		</asp:TextBox>
		
		<asp:button id="btnTestDbSP" onclick="btnTestDbSPClick" runat="server" text="Test Database Stored Procedure" />
		
		<asp:Label runat="server" ID="labelStatus" >
		</asp:Label>
		
		
	</div>


</form>


 

 

testDB.cs


using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
 
 public partial class _Default : System.Web.UI.Page
 {
	 
	private String strDBConnectionString = null;
	private SqlConnection connection = null;
	private String CHAR_NEWLINE = "</BR>";
	
	protected void Page_Load(object sender, EventArgs e)
	{
		
	}
	
	protected Boolean connectDB()
	{
		
		Boolean bDBConnected = false;
		
		try
		{
			
			//strDBConnectionString = ConfigurationManager.ConnectionStrings["EarthConn"].ConnectionString;
			
			if (ConfigurationManager.ConnectionStrings["dbConn"] == null)
			{

				Response.Write("ConfigurationManager.ConnectionStrings['dbConn']");
				
			}
			
			strDBConnectionString = ConfigurationManager.ConnectionStrings["dbConn"].ConnectionString;
			
			if (strDBConnectionString == null)
			{
				return bDBConnected;
			}

				
			connection = new SqlConnection
							  (
								strDBConnectionString
							  );
											
			
			if (connection == null)
			{
				return bDBConnected;				
			}
				
			connection.Open();

			
			if (
					(connection.State == ConnectionState.Open)
				)			
			{
				
				labelStatus.Text += "Connection OK!"  + CHAR_NEWLINE;
				
				bDBConnected = true;
			}
			else
			{
				
				//Response.Write("No Connection!" + CHAR_NEWLINE);
				labelStatus.Text += "Connection OK!"  + CHAR_NEWLINE;				
			}
			
			
		}
		catch (Exception ex)
		{
			
			//Response.Write("No Connection!" + ex.Message + CHAR_NEWLINE);
			
			labelStatus.Text += "No Connection!" + ex.Message + CHAR_NEWLINE;
			
		}
		
		return (bDBConnected);

	}
 
	protected void btnTestDbClick
					(
						  object sender
						, EventArgs e
					)
	{
		
		Boolean bDBConnected = false;
		
		labelStatus.Text = "";
		
		bDBConnected = connectDB();
		
		if (bDBConnected)
		{
				connection.Close();
		}			
		
	}    
	
 
	protected void btnTestDbSPClick
					(
						  object sender
						, EventArgs e
					)
	{
		
		Boolean bDBConnected = false;
		String strDelayLength;
		
		try
		{
		
			labelStatus.Text = "";
		
			//strDelayLength = "00:05:00";
			strDelayLength = txtTimeoutValue.Text;
			
			bDBConnected = connectDB();
			
			// 1.  create a command object identifying the stored procedure
			SqlCommand cmd  = new SqlCommand("dbo.TimeDelay_hh_mm_ss", connection);

			// 2. set the command object so it knows to execute a stored procedure
			cmd.CommandType = CommandType.StoredProcedure;

			// 3. add parameter to command, which will be passed to the stored procedure
			cmd.Parameters.Add(new SqlParameter("@DelayLength", strDelayLength));

			labelStatus.Text += "DB SP Started @ " + DateTime.Now.ToString() + CHAR_NEWLINE;

			labelStatus.Text += "Waiting " + strDelayLength + CHAR_NEWLINE;
			
			// execute the command
			cmd.ExecuteNonQuery();
			
			labelStatus.Text += "DB SP Ended @ " + DateTime.Now.ToString() + CHAR_NEWLINE ;		
			
			if (bDBConnected)
			{
					connection.Close();
			}		

		}
		catch (Exception ex)
		{
			labelStatus.Text += ex.Message;
			throw ex;
		}		
    }
		
	
 }	

 

Output

Processing Wait 15 Seconds

testDB-ReqestWait15seconds

 

Processed Wait 15 Seconds

 

testDB-ProcessedWait15seconds

 

Diagnostics

Failed Request Tracing

Sample files from “Failed Request Tracing“.

FailedRequestTracing-fr000039

 

Why you can’t be a good .Net Developer // Postgres and MySQL

Day Jobs

Day jobs aside, there are some people that have had a thing or two to say in response to an Industry’s rant on “Why you can’t be a good .Net developer“.

Here are some of them….

  1. Enrico, Italian programmer in Sweden.
    On Being a Good .NET Developer
    Link
  2. Ted Neward
    It is too possible
    Link
  3. Ayende @ Rehein
    Why you can’t be a good .Net Developer
    Link

 

Ayende Rahien & Oren Eini

I read through a couple of Oren Eini’s other postings and found out his take on Databases quite promising.

BTW, he blogs under the pseudonym, Ayende Rahien.

 

Evan Klitzke

In a recent post, Ayende summarizes and reflects on Evan Klitzke’s post on “Why Uber Engineering switched from Postgres to MySQL“.

 

  1. WHY UBER ENGINEERING SWITCHED FROM POSTGRES TO MYSQL
    2016-07-26
    Link
  2. Migrating Uber from MySQL to PostgreSQL
    2013-03-13
    Link

Back to Real

Enrico’s Take

“I never compromise on excellence. It’s just that with some teams, the way to get there is longer than with others.

To me the solution isn’t to run away from beginners. It’s to inspire and mentor them so that they won’t stay beginners forever and instead go on to do the same for other people. That applies as much to .NET as it does to any other platform or language.

If you aren’t the type of person who has the time or the interest to raise the lowest common denominator, that’s perfectly fine. I do believe you’re better off moving somewhere else where your ambitions aren’t being held back by inexperienced team members. As for myself, I’ll stay behind — teaching.”

.Net – ASPX – Avoid Parser Error when commenting out code

Background

While trying out different code snippets as I worked on tweaking an ASPX app, I ran into a parser error.

BTW, the enhancement is detailed here.

Let us quickly go over the parser error.

 

Parser Error

 

Code


<asp:TemplateColumn HeaderText="Link" >

	<ItemTemplate>		

	<!--
		
		 <asp:HyperLinkColumn 
				HeaderText="Link" 		
				Text="Link" 
				NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "eventLink") %>'
				Visible="True"
				Target="_blank"
				runat="server"												
				> 	
				
		</asp:HyperLinkColumn>   		    

	-->
	
	 <asp:HyperLink
			HeaderText="Link" 		
			Text="Link" 
			NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "eventLink") %>'
			Visible="True"
			Target="_blank"
			runat="server"
			> 	
	 </asp:HyperLink>   		    		                         																				
	
	</ItemTemplate>
	
</asp:TemplateColumn>


 

Parser Error

Image

ParserError-20160730-0731AM

Textual


Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.HyperLinkColumn does not have a DataBinding event.

Source Error: 

Correct

Here is the change.

Basically, it is to replace “<!–” and “–>” with “<%–” and “–%>“.


<asp:TemplateColumn HeaderText="Link" >

	<ItemTemplate>		

	<%--
		
		 <asp:HyperLinkColumn 
				HeaderText="Link" 		
				Text="Link" 
				NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "eventLink") %>'
				Visible="True"
				Target="_blank"
				runat="server"												
				> 	
				
		</asp:HyperLinkColumn>   		    

	--%>
	
	 <asp:HyperLink
			HeaderText="Link" 		
			Text="Link" 
			NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "eventLink") %>'
			Visible="True"
			Target="_blank"
			runat="server"
			> 	
	 </asp:HyperLink>   		    		                         																				
	
	</ItemTemplate>
	
</asp:TemplateColumn>


 

Acknowledge

Crediting Scott Guthrie

Tip/Trick: Using Server Side Comments with ASP.NET 2.0
Link

ASP.Net – DataGrid – Adding Hyperlink Column

 

Background

There is a dated Black-book web site that I wrote to keep up with people and appointments years ago.

Here is what the Appointments page looks like:

List Appointments

BeforeGrid

Edit Appointment

BeforeEdit

 

Enhancement

Lately, I have found more and more the need to isolate the corresponding web link into its own entry field and not just mushroom it into the comments multi-edit box.

Edit Appointment

AfterEdit

List Appointments

AfterGrid

 

Code

I had a little problem and had to have my brother help me with .Net code to add an hyperlink to a Data Grid.

And, so wanted to place it online for anyone else rusty with ASP.Net

Code line


<asp:DataGrid id="gridContactEventInfo" BorderColor="black" BorderWidth="1" CellPadding="3" AutoGenerateColumns="false" runat="server" font-size="8" width='100%'>

 <HeaderStyle BackColor="#9FBCE3">
 </HeaderStyle>

 <ItemStyle BackColor="#EEF2F7">
 </ItemStyle>
			 
 <AlternatingItemStyle BackColor="#EEEEEE">                                 
 </AlternatingItemStyle>                                 
								  
 <columns>
 
	 <asp:BoundColumn HeaderText="Event" DataField="eventName" /> 


		<asp:TemplateColumn HeaderText="Link" >

			<ItemTemplate>		

			 <asp:HyperLink
					HeaderText="Link" 		
					Text="Link" 
					NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "eventLink") %>'
					Visible="True"
					Target="_blank"
					runat="server"
					> 	
			 </asp:HyperLink>   		    		                         																				
			
			</ItemTemplate>
			
		</asp:TemplateColumn>

	</columns>		

</asp:DataGrid>	

 

Quick Explanation

  1. Added asp:TemplateColumn
  2. Added ItemTemplate
  3. Added asp:HyperLink
    • Added NavigateUrl='<%# DataBinder.Eval(Container.DataItem, “eventLink”) %>’

 

.Net Application – Execution Error – Mixed mode assembly is built against version ‘v2.0.50727’ of the runtime and can not be loaded in the 4.0 runtime without additional configuration information”

 

Error Message


Exception caught in Main()
---------------------------------------
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and can
not be loaded in the 4.0 runtime without additional configuration information.

Fix

To fix add or modify app.config as follow.

Add/Modify App.Config

Explanation

  1. Add startup element
    • Add attribute useLegacyV2RuntimeActivationPolicy=”true”

 

Code

<?xml version ="1.0"?>
<configuration>

  <startup useLegacyV2RuntimeActivationPolicy="true" >
  
  </startup>
  
</configuration> 

BUILD / DEPLOY

Please make sure to copy app.config to [application].exe.config.

A sample compile and deploy file is pasted below.



set "DIR_COMPILER=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319"
set "REF_DLL_LIST=output\Microsoft.SqlServer.Smo.dll, output\Microsoft.SqlServer.ConnectionInfo.dll"

set ConnectionInfo="D:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.ConnectionInfo.dll"
set Smo="D:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.Smo.dll"
set SdkSfc="D:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.Management.Sdk.Sfc.dll"
set SqlEnum="D:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.SqlEnum.dll"

set "APPNAME=bin\Debug\ScriptDB.exe"
set "APPCONFIG_BASE=app.config"
set "APPCONFIG=%APPNAME%.config"

If not exist "bin\Debug" md "bin\Debug"

if exist %APPNAME% del %APPNAME%

%DIR_COMPILER%\csc /reference:%ConnectionInfo%,%Smo%,%SdkSfc%,%SqlEnum% /define:DEBUG /optimize  /out:%APPNAME% *.cs

if exist %APPCONFIG_BASE% xcopy /Y /D %APPCONFIG_BASE% %APPCONFIG%

Credit

Crediting StackOverflow

  1. Mixed mode assembly is built against version ‘v2.0.50727′ of the runtime

 

What is useLegacyV2RuntimeActivationPolicy?

Microsoft’s WriteUp

Here is Microsoft’s write-up

useLegacyV2RuntimeActivation

In Microsoft .Net v4.0 and later, legacy runtime activation is not allowed.

 

What Framework is SQL Server Management Objects (SMO) Compiled Against?

What .Net Framework is the SQL Server Management Object (SMO)  Version 9 compiled against?

One way to find out is to use a .Net Decompiler.

.Net Decompilers

There are a couple of .Net Decompilers.

  1. JetBrains
  2. Telerik

 

JetBrains – DotPeek

Pick DLL

PickSQLServerSMO

 

Assembly Explorer

AssemblyExplorer-Use

Explanation:

  1. We can see the SQL Server SMO ( v9) is compiled against .Net Framework v3.5

Building Microsoft Enterprise Applications from the Command Line

Background

Reviewing an Application that makes heavy use of Microsoft’s Enterprise Library.

Unfortunately, my installed copy of Microsoft’s Visual Studio is not working and everything has to be done through the command line.

Here is how I stumbled through.

Compilation

When we invoked csc, encountered the error pasted below.

Error


Daily.cs(11,17): error CS0234: The type or
namespace name 'Practices' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

Daily.cs(18,17): error CS0246: The type or namespace name 'Database' could not be found (are you missing a using
directive or an assembly reference?)

Source Code

Here is what lines 11 and 18 look like.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Data;
using System.Data.Common;
using System.Configuration;


using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Transactions;

namespace reporting
{
    public class reportManager : ReportManager<DailyPaymentTransactionData>
    {
        private Database db;


Explanation

The cited lines are:

  1. Using Microsoft.Practices.EnterpriseLibrary.Data;
  2. private Database db;

 

Download Enterprise Library

Download Microsoft’s Enterprise Library from https://msdn.microsoft.com/en-us/library/ff632023.aspx.

Install Enterprise Library

Here we installed Microsoft Enterprise Library unto our machine.

CustomSetup

I will urge you to keep in mind the target folder.

Code Revision

Compile Code

Here is the original & revised compiler invocation statements.

Original


C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /define:DEBUG /optimize /out:reporting.exe *.cs 

Revised


C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /define:DEBUG /optimize /out:reporting.exe *.cs /r:"Microsoft.Practices.EnterpriseLibrary.Data.dll" /r:"Microsoft.Practices.EnterpriseLibrary.Common.dll"

Explanation

  1. Added a reference ( using /r )  to Microsoft.Practices.EnterpriseLibrary.Data.dll
  2. Added reference to Microsoft.Practices.EnterpriseLibrary.Common.dll

Execution

Error

Missing Dlls

 

 

Error Missing
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified. Microsoft.Practices.EnterpriseLibrary.Data
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system
cannot find the file specified.
Microsoft.Practices.EnterpriseLibrary.Common
 Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.InnerCreateDatabase(String name)
 Microsoft.Practices.ServiceLocation
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.CreateDefaultContainer
( IConfigurationSource configurationSource )
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.SetCurrentContainerIfNotSet()
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.InnerCreateDatabase(String name)
Microsoft.Practices.Unity
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Practices.Unity.Interception, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.
Unity.UnityContainerConfigurator..ctor(IUnityContainer container)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.CreateDefaultContainer(IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibra
ryContainer.SetCurrentContainerIfNotSet()
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.InnerCreateDatabase(String name)
‘Microsoft.Practices.Unity.Interception

 

Missing Application Configuration File

Here is one of the errors we saw:


Unhandled Exception: Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type Database, key "DEDB"

 ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "DEDB".

Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type Database cannot be constructed. You must configure the container to supply this value.
-----------------------------------------------
At the time of the exception, the container was:

  Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,DEDB
 ---> System.InvalidOperationException: The type Database cannot be constructed.
 You must configure the container to supply this value.
   at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.GuardTypeIsNonPrimitive(IBuilderContext context, SelectedConstructor selectedConstruct
or)
   at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.PreBuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlanCreatorPolicy.CreatePlan(IBuilderContext context, NamedTypeBuildKey buildKey)


Explanation

  1. In our case the Application configuration’s file was missing all together
  2. Yes, we had App.Config file
  3. In the IDE, msbuild uses the App.Config file to produce the bin\Debug\<app>.exe.config file

Sample Configuration File


<?xml version="1.0" encoding="utf-8" ?>
<configuration>

   <connectionStrings>
    
	<add name="DEDB" connectionString="Data Source=HRDB;Initial Catalog=HRDBDev;Persist Security Info=True;User ID=reporter;Password=123TRS" providerName="System.Data.SqlClient" />
    
   </connectionStrings>  
  
</configuration>


MSBUILD

Rather than using csc we should have used msbuild.

Pasted below are the screenshots from invoking msbuild; along with a brief description of what is being accomplished.

Build

Enterprise Library Files

Here we have the Enterprise Library files copied from our installed folder to the destination folder ( bin\debug):

msbuild-EnterpriseLibrary-CopyingFile

App.config File

Here the app.config file copied to bin\debug\[application].exe.config

appConfigFile

EXE and PDB

Here the executable and the PDB, a program database file which holds debugging and project state information and allows for incremental linking of a Debug configuration of our program, are copied to the bin\debug folder.

ExeAndPDB

 

BIN FOLDER

Here is what our bin\debug folder look like

bin-debug-folder

Summary

Really should have issued msbuild as it will have made use of the existing msproj file.

Issuing msbuild would have copied the Enterprise Library Dlls and mirrored the app.config as [app].exe.config file.