.NET Interview Questions and Answers

· Differences

1. Difference between Classic ASP and ASP.Net?
Answer:
§ ASP is Interpreted language based on scripting languages like Jscript or VBScript.
§ ASP has Mixed HTML and coding logic.
§ Limited development and debugging tools available.
§ Limited OOPS support.
§ Limited session and application state management.
§ Poor Error handling system.
§ No in-built support for XML.
§ No fully distributed data [...]

Export excel sheet data from dataset in ASP.NET

Environment :
                

ASP.NET 1.1v
Visual C#
SQL Server2000
MS Excel2003
Microsoft Visual Studio2003

1. Create one webapplication using visual studio.
2. Just put the button text as “Exports to Excel” in webform1.aspx.

3.  Use the following namespaces for this application
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
4. In button(Exports to Excel) click event

SqlConnection conn            =    new SqlConnection(ConfigurationSettings.AppSettings["PubsConnection"]);
                SqlCommand    [...]