Skip to main content

Posts

ASP.NET State Management Overview

A new instance of the Web page class is created each time the page is posted to the server. In traditional Web programming, this would typically mean that all information associated with the page and the controls on the page would be lost with each round trip. For example, if a user enters information into a text box, that information would be lost in the round trip from the browser or client device to the server. To overcome this inherent limitation of traditional Web programming, ASP.NET includes several options that help you preserve data on both a per-page basis and an application-wide basis. These features are as follows: • View state • Control state • Hidden fields • Cookies • Query strings • Application state • Session state • Profile Properties View state, control state, hidden fields, cookies, and query strings all involve storing data on the client in various ways. However, application state, session state, and profile properties all store data in memory on the ...

How to Read Mails from Outlook and Checking for particular User Mail

Microsoft.Office.Interop.Outlook .Application oApp; Microsoft.Office.Interop.Outlook._NameSpace oNS; Microsoft.Office.Interop.Outlook.MAPIFolder oFolder; Microsoft.Office.Interop.Outlook._Explorer oExp; oApp=new Microsoft.Office.Interop.Outlook.Application(); oNS = (Microsoft.Office.Interop.Outlook._NameSpace)oApp.GetNamespace("MAPI"); oFolder=oNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders. olFolderInbox); oExp = oFolder.GetExplorer(false); oNS.Logon(Missing.Value, Missing.Value, false, true); Microsoft.Office.Interop.Outlook.Items items = oFolder.Items; //checking for unread mails foreach (Microsoft.Office.Interop.Outlook .MailItem mail in items) { if (mail.UnRead == true) { //Paste the code for already opened mails if (mail.SenderName.Trim() == "crozzX") { //Past...

How to store Excel data in Gridview

Import System.Data.OleDb(using System.Data.OleDb)in code behind file Then in button onclick event write, OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OleDb.4.0;Data Source=D:\status.xls;Extended Properties=Excel 8.0"); OleDbCommand command = new OleDbCommand("SELECT * FROM [Sheet1$]", connection); OleDbDataReader dr; connection.Open(); dr = command.ExecuteReader(CommandBehavior.CloseConnection); DataTable excelData = new DataTable("ExcelData"); excelData.Load(dr); GridView1.DataSource = excelData; GridView1.DataBind();

Difference Between Eval and Bind in ASP.NET

Eval is a protected method defined on the TemplateControl class, from which the Page class is derived. Bind is a new ASP.NET 2.0 databinding keyword. It's not a method of any specific class. Eval is used for unidirectional (readonly) data binding, while Bind is for bi-directional (editable) databinding. ASP.NET supports a hierarchical data-binding model that creates bindings between server control properties and data sources. Almost any server control property can be bound against any public field or property on the containing page or on the server control's immediate naming container. Data-binding expressions use the Eval and Bind methods to bind data to controls and submit changes back to the database. The Eval method is a static (read-only) method that takes the value of a data field and returns it as a string. The Bind method supports read/write functionality with the ability to retrieve the values of data-bound controls and submit any changes made back to the database. You...