Skip to main content

Posts

Showing posts from 2006

ASP.NET Questions

Why are you more likely to use HtmlControls rather than WebControls when migrating from ASP? Choice 1 ASP pages are made from HTML elements, not controls, which map to the HtmlControls better. Choice 2 HtmlControls involve less development effort. Choice 3 HtmlControls have the same syntax as ASP HtmlControls. Choice 4 HtmlControls can be used to transfer ASP session state. Choice 5 ASP also uses HtmlControls. In a Web application, how many security-related events does the global.asax file provide? Choice 1 1 Choice 2 2 Choice 3 3 Choice 4 4 Choice 5 More than 4 Why does the Page object have an IsPostback property? Choice 1 It is used to know that control events need to be thrown. Choice 2 It is used in the Application_BeginRequest event to decide whether to authenticate a user. Choice 3 It is used so that the Page can determine whether to load Viewstate. Choice 4 It is used to determine whether to throw the Page_PostBack event. Choice 5 It is used so that the controls can be loaded wi

Multi Lingual page ASP.NET

Here the commented part would be the client side calling in ASP.NET file using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Resources; namespace NewMultiLingual { /// /// Summary description for WebForm1. /// public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.Literal usernameLabel; protected System.Web.UI.WebControls.TextBox username; protected System.Web.UI.WebControls.Literal passwordLabel; protected System.Web.UI.WebControls.TextBox password; protected System.Web.UI.WebControls.Button login; private void Page_Load(object sender, System.EventArgs e) { ResourceManager Rm1 = new ResourceManager("NewMultiLingual.Resource",System.Reflection.Assembly.GetExecutingAssembly()); usernameLabel.Text = Rm1.GetString("Username"); passwordLabe

ASP.NET

Blog on ASP.NET New in ASP .NET Better language support Programmable controls Event-driven programming XML-based components User authentication, with accounts and roles Higher scalability Increased performance - Compiled code Easier configuration and deployment Not fully ASP compatible Language Support ASP .NET uses the new ADO .NET. ASP .NET supports full Visual Basic, not VBScript. ASP .NET supports C# (C sharp) and C++. ASP .NET supports JScript as before.

C#

Namespaces Namespaces are C# program elements designed to help you organize your programs. They also provide assistance in avoiding name clashes between two sets of code.

SQL

*********************************************************************************** Deleting duplicate records in a table select DISTINCT * into #temp from table1 --apply where condition delete from table1 insert table1 select * from #temp drop table #temp table names starts with # will truncated and dropped after application end *********************************************************************************** get day from date sql datename("dw",getdate()) *********************************************************************************** select getdate() To convert a given date to normal format select convert(nvarchar(12),getdate(),103) ***********************************************************************************

To invoke a specified application at specified time

This is the windows service which will invoke a application at 5.30 pm Here I am invoking a web page using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.ServiceProcess; using System.Timers; using System.Configuration; using System.Globalization; namespace WinWin { public class WinService1 : System.ServiceProcess.ServiceBase { /// /// Required designer variable. /// /// // private System.Timers.Timer aTimer; private System.ComponentModel.Container components = null; //private System.Timers.Timer aTimer = new System.Timers.Timer(); //private System.ComponentModel.Container components = null; private System.Timers.Timer aTimer; public WinService1() { //System.Timers.Timer aTimer; // This call is required by the Windows.Forms Component Designer. InitializeComponent(); // TODO: Add any initialization after the InitComponent call } // The main entry point for the process //pr