asp.net

Execute Commands Methods: How to use it?

Submitted by planetsourcecode on
We have 4 types of Exceute methods, through which we can excecute the quries angainst Database. 1). ExecuteNonQuery(() 2). ExecuteReader() 3). ExecuteScalar() 4). ExceuteXmlReader() 1). ExecuteNonQuery(() Explanation: Executes a command but does not return any value or output usage conditions: UPDATE, INSERT, DELETE statements using System; using System.Data;

Check Existence of File in ASP.NET and C#

Submitted by planetsourcecode on
We have to check if file exists before doing some things with that particular file. It will prevent error and work flow will be smooth, for this we have to include required namespace i.e system.IO; Using system.IO; We have to place these controls on the webpage (ASPX page) Text box with ID=Textbox1 Button with ID= button1 Label with ID= label1

ASP.NET Validation Tips and Tricks (Part1)

Submitted by planetsourcecode on
Tips1# Validate an IP address We can easily validate an IP address by Adding Namespace using System.Text.RegularExpressions; public class IPAddressTextBox: RegExTextBox { public IPAddressTextBox() { InitializeComponent(); this.ValidationExpression = @"^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$";

Skins and themes in ASP.NET

Submitted by planetsourcecode on
Sometimes we have to design those pages which have different color schemes but it is very difficult to maintain these types of pages. We can overcome from this situation by using skins and themes. This makes these things easier. 1). First create a Master Page having the following components. * One Content Placeholder 2).Create another page (default.aspx) and select the Master Page

Converting domain names to IP addresses

Submitted by planetsourcecode on
In ASP.NET, we can easily convert the Domain names to its related IP address like if a website like planetsourcecode.in has a domain name i.e planetsourcecode.com, It has also a corresponding Internet Protocol Address like 208.111.14.112. this can be easily done in ASP.NET using C# Steps for doing this: 1). First we have to include the namespace for this class Using System.net;