Steps to Create Setup and Deployment Project in Dot Net VS 2008

Step 1
Create your own windows application. Create a new Windows application project in C# and named it as Sample.


Step 2

Design your own application. Here we have a simple login form for example.

Step 3
After completing the design and coding, build the solution of the project in release mode.


Step 4
Check the Release folder for the file “ProjectName.exe”. Here in this example we have the project name as sample so we can find a file with the name Sample.exe. Double click the executable file and check the example.


Step 5
Create a Deployment Project. Select the “Other Project Types” -> “Setup and Deployment” -> “Setup project”. Here we have the setup project for example as “SampleSetup”.


Step 6
Add the Sample.exe project application file inside the “Application Folder”.


Step 7

To make a shortcut for the project right click “File System on Target Machine” and create shortcut of the application. Here in this example the project shortcut is created in program files folder.


Step 8
Create the shortcut of the application.


Step 9
Rename the shortcut of the application.


Step 10
Move the Shortcut file to specified target. Note if you need another shortcut for some other target also create use same steps.


Step 11
Now build the solution in release mode.


Step 12
The setup file created in release folder of the project specified path.


Step 13
Run the setup, step the path to extract.





Step 14
The SampleSetup project is extracted and shortcuts are created. Now run your application.



Simple Add,Edit,Retrieve and Delete in

Here is a example application of Add,Edit,Retrieve and Delete operations using Download Creating a table employeeinfo for proceeding the operations. Sql Table Creation

CREATE TABLE employeeinfo ( empid INT NOT NULL PRIMARY KEY, empname VARCHAR(50), empaddress VARCHAR(200), empsalary INT )

Declaring Connection String and Variables

Namespace : using System.Data.SqlClient;  string QryStr = ""; SqlConnection con = new SqlConnection("Server=servername;Integrated Security=true;Database=employee"); SqlCommand cmd; SqlDataReader dr;

In this example i have used windows authentication.You have to change the connection string according your specification. Adding Records

QryStr = "INSERT INTO employeeinfo VALUES('" +txtEmpId.Text + "','" + txtEmpName.Text + "','" + txtEmpAdd.Text + "','" + txtEmpSal.Text + "')"; con.Open(); cmd = new SqlCommand(QryStr, con); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); con.Close();

Updating Records

QryStr = "UPDATE employeeinfo SET empname = '"+txtEmpName.Text+"',empaddress = '"+txtEmpAdd.Text+"',empsalary = '"+txtEmpSal.Text+"' WHERE empid = '"+txtEmpId.Text+"'"; con.Open(); cmd = new SqlCommand(QryStr, con); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); con.Close();

Retrieve Records to textboxes Records will be Retrieved from the database and displayed in the text boxes when text change of employee id is fired.

QryStr = "SELECT * FROM employeeinfo WHERE empid = '" + txtEmpId.Text + "'";  con.Open(); cmd = new SqlCommand(QryStr, con); dr = cmd.ExecuteReader(); dr.Read(); if (dr.HasRows) { txtEmpName.Text = dr["empname"].ToString(); txtEmpAdd.Text = dr["empaddress"].ToString(); txtEmpSal.Text = dr["empsalary"].ToString(); } else { txtEmpName.Focus(); } con.Close();

Deleting Records

QryStr = "DELETE FROM employeeinfo WHERE empid = '" + txtEmpId.Text + "'"; con.Open(); cmd = new SqlCommand(QryStr, con); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); con.Close();

What is ViewState ?

ASP.NET view state is the technique used by an ASP.NET Web page to persist
changes to the state of a Web Form across postbacks.That is when a form is submitted in ASP .NET, the form reappears in the browser window together with all form values.

The ViewState indicates the status of the page when submitted to the server. The status is defined through a hidden field placed on each page with a <form runat=”server”> control.

Hidden field placed on each page would be something as this
< input type=”hidden” name=”__VIEWSTATE” value=”CEbzzzEnmmz+Bc8IDFlnpgCLJ/HB00.” >
Maintaining the ViewState is the default setting for ASP.NET Web Forms. If you want to NOT maintain the ViewState, include the directive l%@ Page EnableViewState=”false” %> at the top of an .aspx page or add the attribute EnableViewState=”false” to any control.

What is Tracing?

Tracing is a refined process for outputting page-level information.When tracing is enabled you automatically get information on the ASP.NET Web page. Information like:

Request Details – Session Id; Request time, type, and encoding; status code, etc.
Trace Information – Page-level ASP.NET messages that you specify via Trace.Write and Trace.Warn.
Control Tree – A listing of the Web controls on theASP.NET Web page,and how they relate to one another.
Cookies Collection – A listing of all of the cookies.
Headers Collection
– A listing of all of the HTTP headers.
Server Variables – A listing of all of the server variables.

Trace statements are processed and displayed only when tracing is enabled. You can control whether tracing is displayed to a page, to the trace viewer, or both.

.Net Framework 4.0 Universe

Microsoft announced Visual Studio 2010 and the .NET Framework 4.0 on September 29, 2008 which marks the next generation of developer tools from Microsoft.

Based upon .NET Framework 4.0 Brad Abrams released a poster “.Net Framework 4.0 universe” , which gives you a clear view of new stuffs in .NET Framework 4.0.You can download the poster in PDF format.

Visual Studio 2010 and the .NET Framework 4.0 deliver key innovations in the following pillars:

  • Democratizing Application Lifecycle Management
  • Enabling emerging trends
  • Inspiring developer delight
  • Riding the next generation platform wave
  • Breakthrough Departmental Applications

You can have a overview of Visual Studio 2010 and .NET Framework 4.0 from msdn.

What Is ASP.Net?

ASP.NET is a web application framework built on the common language runtime used to build dynamic web sites, web applications and XML web services.ASP.NET is the next generation ASP, but it’s not an upgraded version of ASP.

ASP.NET is a program that runs inside IIS and is a part of Microsoft’s .NET platform. ASP.NET allows you to use a full featured programming language such as C# (pronounced C-Sharp) or VB.NET to build web applications easily. An ASP.NET file has the file extension “.aspx” .

ASP.NET makes it simple to use XML for data storage, configuration and manipulation. The tools which are built into ASP.NET for working with XML are very easy to use.
Best of all, ASP.NET pages work in all browsers including Netscape, Opera, AOL, and Internet Explorer.

Visual Studio 2005 adds the productivity of Visual Basic-style development to the Web. Now you can visually design ASP.NET Web Forms using familiar drag-drop-double-click techniques, and enjoy full-fledged code support including statement completion and color-coding. VS.NET also provides integrated support for debugging and deploying ASP.NET Web applications.