home » blogs » Vijjendra

ASP.NET Blogs

CodeAsp.Net's ASP.NET Blogs is more than just a social community for ASP.NET bloggers - we are one of the largest ASP.NET blog directories on the internet. Whether you are looking to search ASP.NET blogs, connect with ASP.NET bloggers, learn more about ASP.NET, or promote your own blog, CodeAsp.Net is for you. Be sure to check back often as we add new ASP.NET blog postings frequently.

Blogs RSS Feed

Vijjendra : Most Recent postings

Difference between Literal and Label in ASP.NET

7/13/2010 5:07:56 PM by Vijjendra   -   1 Comments   -   Views: 3675

Literal Control: It is used to display data; it is lightweight and does not make any formatting techniques. Literal control will render only its text which is assigned in its text property. For example: < div > < asp : Literal ID ="Literal1" runat ="server" Text ="This is a literal control"> </ asp : Literal > </ div > this code render as: < div > This is a literal control</ div > Label Control: It is also used for display data, it makes formatting techniques ...

Read More

Calculate Business days in ASP.NET C#

6/18/2010 8:47:03 AM by Vijjendra   -   0 Comments   -   Views: 261

Download Sample Project Many times we want to find out the next business (working) date after “N” business days. In this blog I have described how to find out the next business date after “N” business days. Here “N” is the number of business days. Business days means remove all the Sunday and Saturday which falls between “N” business days from the current date(Or from specified date). Below given method find out, that current day is Saturday or Sunday i.e find out the WeekEnd. public static bool...

Read More

Find Leap year in ASP.NET(C#)

6/17/2010 6:51:41 AM by Vijjendra   -   3 Comments   -   Views: 368

Leap year a year which have the 1 extra day from normal year, in leap year February have 29 days, in normal February have 28 day. Leap year has 366 days but normal year have 365. To find the given year is the leap year, for that the algorithm is: 1. Year should be completely divided by 4 i.e. reminder should be zero. 2. AND, Year should not be completely divided by 100 i.e. reminder should not be zero. 3. OR, Year (Centaury) should be completely divided by 400 i.e. reminder should be zero. We ca...

Read More

Delete,Truncate All Table's data from Database in SQL Server

6/17/2010 6:51:35 AM by Vijjendra   -   0 Comments   -   Views: 312

In this blog I have discussed about how to Drop all the user defined table from the database OR Select/Delete/Truncate data from all the database tables OR alter the entire database table in one command. In SQL Server there is a system defined Procedure to perform Select, Delete, Truncate, Drop, Alter command on the entire database table in one shot command, the name of the procedure is: Sp_MSforeachtable this procedure takes 7 parameter in this 2 parameters are mendotarory rest 5 are optional. ...

Read More

Generate BarCode in ASP.NET

5/4/2010 12:00:00 AM by Vijjendra   -   3 Comments   -   Views: 1613

Barcode is a machine readable representation of data, which contains the data information. Basically barcode contains data information in parallel line. The most popular of barcode used font is “3 of 9” also known a code 39. Download Font Download barcode from above link and exact these in a folder after that just copy and paste font on the following location Control Panel >> Font. Basically during barcode generation we first create a text with the help of font in parallel lines, after tha...

Read More

Find Maximum value from an Enum

11/29/2009 12:11:22 AM by Vijjendra   -   2 Comments   -   Views: 808

Here I have discussed find the maximum value from enum. Suppose we have an enum like: public enum TestEnum { A=1, X=2, E=3, R=4, O=5 } if our enum have values like above(Incremented by one),then we can Find the Max enum values like as follows: String strMaxEnumValue = Enum .GetValues( typeof ( TestEnum )).Cast< TestEnum >().Last().ToString(); It returns last element of the sequence. It gives you "O" as result. int maxEnumValue = Convert .ToInt32( Enum .GetValues( typeof ( TestEnum )).Cast&...

Read More

What is Paged DataSource?

11/12/2009 8:47:17 AM by Vijjendra   -   0 Comments   -   Views: 1228

PagedDataSource is a class which encapsulates the paging related properties which is required to perform paging in data bound control like Repeater/DataList. PagedDataSource class comes under System.Web.UI.WebControls namespace. PagedDataSource contains following common properties: PageSize: It Defines number of records shown on the page. it’s default value is 10. AllowPaging: Indicating whether paging is enabled for data bound control or not. Its default value is “false”. CurrentPageIndex: It s...

Read More

Find Date after a given week(s) or month(s)

11/4/2009 4:53:20 AM by Vijjendra   -   0 Comments   -   Views: 772

Here I am discussing to find date after a given week or months. For example I want to find the date after 1 week or 2 months from today. Find date after 2 week or 2 months then we can achieved this as like: DateTime dateTime = DateTime.Now.AddDays(14); //we can also do this as DateTime.Now.AddDays(2*7) DateTime dateTime1 = DateTime.Now.AddMonths(2); The output will be: 11/18/2009 3:59:43 PM 1/4/2010 3:59:43 PM If we want only date part then we can achieved this as like: string dt = DateTime.Now....

Read More

Find Enum Name from Value

10/30/2009 2:33:30 PM by Vijjendra   -   0 Comments   -   Views: 1210

Here I have discuses find name of Enum from Enum value. I have a Enum like: public enum EnumName { Vijendra=1, Singh=2, Shakya=3 } I have the value of this Enum in my database table, when I fetch that value from database then we want to show this value as Enum name. For example in my database there is 2 when I retrieve it from database then I want to show it “Singh” instead of 2.I have done this as follows: int enumValue = 2//suppose this value is retrieve from databse string strName...

Read More

Auto refresh page

10/6/2009 7:54:16 AM by Vijjendra   -   8 Comments   -   Views: 2189

Here I have discussed how we auto refresh page and why we need to auto refresh the page. Page is Auto refresh means forcing a page to post back without user input. Following are the main reason to auto refresh the page. 1. Redirecting to a new URL after some specific time. 2. Refreshing page information within a given time period. 3. Maintain a session state. We auto refresh the page in following way: <meta http-equiv="refresh" content="30;url=http://www.codeasp.net/"> Put this line inside...

Read More

Join CodeAsp.Net for FREE Today!

It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.

enter your email address: