Data in an Excel file can be manipulated using Vb.Net without even opening the file. With few steps this can be done. Previously we have created Excel file from Vb.Net with auto formatting technique. If you have missed it, then you should check this link. In this article we’ll show you how to modify data in an existing Excel file with the click of a button.
Before starting the designing of the application, we need to add a “COM” library from the reference window. In the .Net IDE, click “Project” from the top menu list and select “Add Reference…” In the “Add Reference” window, select “COM” tab and find “Microsoft Excel 12.0 Object Library” from the list. Select it and click OK.
Learn more about it.
Tuesday, December 25, 2012
Saturday, December 22, 2012
How to assign and access Session Variables from a Class in Asp.Net?
What is a Session Variable and why use it?
Every time a user visits a website, a new session is maintained for a specific period of time. During this session, the server records specific information about the user till the user logs out or closes the browser. The recorded sessions can be used throughout the website (pages) for specific reasons. This information can be stored using “Session Variables”.
E.g. Session(“mark”) = “a value”
The above example can be written in a variety of ways in a web page.
Design Mode (Asp.Net)
<% If Session("mark ") = “x” Then Some code here… Else And here… End If %>
Code behind
Protected Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles frmMemberList.Load If Session("mark ") = “x” Then Some code here… Else And here… End If End Sub
Thursday, December 20, 2012
Export data to Excel in Vb.Net with Auto format technique.
Data can be exported to an excel sheet in Vb.Net using Microsoft.Office.Interop.Excel namespace. Though it’s a classic example, exporting data into an excel file can be useful when you want to share your data in a well formatted way. Ms-Excel 2003 had an in built feature which allowed users to “Auto format” the entire sheet with ease. This feature is still available in the .Net framework for developers to work with excel formatting.
http://www.encodedna.com/2012/12/export-data-to-excel.htm
The “Auto Format” function in the application will automatically format the sheet immediately after the entire data is export into the excel sheet.
Note: ExcelAutoFormat.xlRangeAutoFormatList3, comes with a variety of formats which you should try.
Before starting the designing of the application, we need to add a “COM” library from the reference window. In the .Net IDE, click “Project” from the top menu list and select “Add Reference…” In the “Add Reference” window, select “COM” tab and find “Microsoft Excel 12.0 Object Library” from the list. Select it and click OK.
http://www.encodedna.com/2012/12/export-data-to-excel.htm
Sunday, December 16, 2012
Validate at client to accept only numbers in a textbox using JavaScript.
Client side validations become very important when submitting client entered data on a WebForm. Now here is case where we want check if a particular field accepts only numbers, and it should not allow other characters as input. The validation will be done at the client side before the post back event is called.
http://www.encodedna.com/2012/12/JavaScript-accept-only-numbers-textbox.htm
http://www.encodedna.com/2012/12/JavaScript-accept-only-numbers-textbox.htm
Sunday, December 9, 2012
How to open a new window from Gridview using JavaScript? - Asp.Net
A Gridview control is good way to display data in a tabular format with its rich features and functions. An entire database table can be displayed on the browser. These data can be manipulated using the Gridview functions.
But some times we need to open a new Window from a Gridview by the click of a button. The purpose of opening a new window can be anything like, displaying corresponding data from a different database table etc.
http://www.encodedna.com/2012/12/open-new-window-gridview.htm
http://www.encodedna.com/2012/12/open-new-window-gridview.htm
Subscribe to:
Posts (Atom)