Friday, September 29, 2006

Visual Studio 2005 Web Deployment Projects

In Visual Studio 2005 there no option exist for build deployment DLL for your web application by default. We need to install Visual Studio 2005 Web Deployment Projects to enable this deployment option in your visual studio 2005. A Web Deployment Project creates and maintains an MSBuild project file, and is associated in a solution with a Web Site Project or Web Application Project. Here is the download link for "Visual Studio 2005 Web Deployment Projects".

After installing select your website in your solution explorer.













After that go to Build menu and select Add Web Deployment Project.











The Web Deployment property will be added to your website.


Then double click on the Web Deployment property you added to your website, the property window opens, in that you can set whatever deployment property to set for your solution.




learn more about Visual Studio 2005 Web Deployment Projects in the follow link. Learn more>>

Friday, September 22, 2006

System.Data.SqlClient.SqlParameterCollection.Add(string, object)' is obsolete: 'Add(String parameterName, Object value) has been deprecated.

For all .NET programmers who are using this

SqlCommand.Parameters.Add("@MyValue","Value");

code in ADO.NET 2.0 will get a deprecation message. Instead of using this code, you need to use the following code

SqlCommand.Parameters.AddWithValue("@MyValue","Value");

this " SqlCommand.Parameters.Add("@MyValue","Value"); " is a ADO.NET 1.1 way of coding, if you are still using this code in ADO.NET 2.0, you will get the following warning message.

" 'System.Data.SqlClient.SqlParameterCollection.Add(string, object)' is obsolete: 'Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value). http://go.microsoft.com/fwlink/?linkid=14202' C:\Documents and Settings\501597\My Documents\Visual Studio 2005\WebSites\mytool\MyFirstPage.aspx.cs 149 10 C:\...\doc\ "

This is because of some other API changes in the framework. Checkout the list of obsolete changes in the following links
http://msdn.microsoft.com/netframework/programming/obsoleteapi/ObsByAssembly.aspx
http://www.gotdotnet.com/team/changeinfo/default.aspx

Tuesday, September 19, 2006

XML and XSLT transformation using C#.NET

With XML Document you can illustrate data hierarchically without caring about the later output format, and with XSL-Transformations you have the ability to convert the data content of that XML document into various formats such as text, xml, html etc. XSLT, the extensible style sheet language for transformations, is a language that provides the mechanism to transform and manipulate XML data. It is used to transform XML documents into another documents, for example other XML document, HTML document or text document. XSLT processors parse the input XML document, as well as the XSLT style sheet and then process the instructions found in the XSLT style sheet, using the elements from input XML document.

Here in this sample I have explained you the XML and XSLT transformation using C#.NET 2.0.
C#.NET 2.0. Before transformation my tool will look like this...








After you select your XSLT and XML files when you click on the preview button the output is displayed as HTML in the webBrowser control.



For more see the sample code...


XPathDocument xmlFileDoc = new XPathDocument(txtxmlfilepath.Text.ToString());
XmlTextWriter myWriter = new XmlTextWriter("result.html", null);
XslCompiledTransform XSLpreview = new XslCompiledTransform();
XSLpreview.Load(txtxslfilepath.Text.ToString());
XSLpreview.Transform(xmlFileDoc, null, myWriter);
myWriter.Close();
webBrowser1.Navigate(@"C:\result.html");

Download The Sample Solution

Monday, September 04, 2006

How to store errors in the trace.axd

Using Trace.xsd in asp.net applications is a nice feature to log errors. To get this work you have to create a web.config which must reside in the application root folder.

The web.config looks like this:

Now whenever an error occurs it is logged and can be accessed via the following url: http://localhost/urapplication/trace.axd

I use the user name "superuser" for illustration only. You could also say .

Depending on if you are using Forms authentication or Windows authentication, you'd either use a user/role name that you've defined, or one that Windows defines such as "USER\Administrators" or DOMAIN\youraccount

Features enriched in Visual Studio 2005 Team Suite

Visual Studio 2005 Team System is a productive, integrated, and extensible suite of lifecycle tools that expands the Visual Studio product line to enable greater communication and collaboration among software development teams. With Visual Studio 2005 Team Suite organizations can ensure greater predictability and quality early and often throughout the development process.

Key features enriched in VSTS:

Automatic and Manual Conflict Resolution Tool: The Automatic and Manual Conflict Resolution Tool handles issues caused by multiple users working on different versions of the same file.

Atomic Checkins: Team Foundation Server enforces atomic check-in to help maintain the integrity of files under source control.

Auto-Using: The Visual Studio 2005 Integrated Development Environment (IDE) includes Smart Tag support for auto-using statements.

Branching: Branching allows the creation of multiple similar code bases.

Bug List: With Visual Studio Team System (VSTS), you can easily find, track, and view bugs by using the Bug List report.

Better ASP .NET Source Code Editing: With the Visual Studio 2005 source code editor, Intellisense and new features for formatting, navigating and validating your HTML markup are available throughout your files.

Built-in SQL Server 2005 Express Support: You can develop and debug database objects for your application in Visual Studio 2005, even if you don't have access to SQL Server 2005.
Caching Improvements: Team Foundation Server is ideal for geographically distributed teams because of its server-based nature.

Check-in Notes: With Team Foundation Server Check-in Notes, administrators may collect data from users during the check-in process.

Check-in Policy: Team Foundation Server check-in policies provide a way for administrators to enforce development practices across a development team.

ASP.NET MVC - Sport Facility Booking system

  The project relies on some external service providers. Thus accessing them via their API requires authentication. An API Key need to be su...