Monthly Archives: April 2012

ASP.Net – String Function

 1.    Substring(start index, substring length=&2=&- C# Substring function returns a part of specified string. =&3=&  2. Split()-  Use Split to separate parts from a string. If your input string is “A,B,C” you can split on the comma to get an array of: “A” “B” “C”.

String  sname  = ” there is a dog”;

String []  output = sname.Split(‘   ‘);

=&6=&for(int i=0; i<=output.Length – 1; i++) =&7=&=&8=&String.Length=&9=&  4.   Remove(start index, Removestring length)

- C# Remove String function returns the string value by deleting the specified set of characters.

- String  strText = “MeeraAcademy”;

- Response.Write(strText.Remove(2 , 3));

read more

ASP.Net with SQL-Server Connection

  • There are many method for connecting ASP.Net Application to SQL-Server.
  • We are discussing basic three method below for connection.
    Method I
    Step 1 -   Import  Namespace

                using System.Data.Sql;

using System.Data.SqlClient;


Step 2 – Delcare SqlConnection
(Make Connection between Asp.Net Application to Sql Server)
string  strconn = “Data Source=COMPUTERNAME\\SQLEXPRESS;Initial Catalog=’DataBaseName’;Integrated Security=True”;

SqlConnection SqlConn = new SqlConnection(strconn);


Step 3 – Declare SqlDataAdapter
(SqlDataAdapter is a Bridge between DataBase and DataSet/DataTable)
SqlDataAdapter SqlAdapter = new SqlDataAdapter(“select * from Table”, SqlConn);


Step 4 – Declare DataSet/DataTable and fill the data from DataAdapter
DataTable DT = new DataTable();
            SqlAapter.Fill(DT);

read more

SQL BETWEEN Operator

SQL BETWEEN Operator. SQL BETWEEN Operator - The SQL BETWEEN operator is used to returns records match between two values in WHERE Condition.The range of value should be text, numbers or dates.

SQL IN Operator, SQL NOT IN Operator

SQL IN Operator, SQL NOT IN Operator. SQL IN Operator - The SQL IN operator used to select column with more than one value in WHERE condition. The IN operator allow us to specify the more than one value in Where condition.

SQL LIKE Operator

SQL LIKE Operator. SQL LIKE Operator - The SQL LIKE operator is used to returns all rows from a table whose column value match a specific pattern.

What is SQL Statements?

  • There are two types of SQL Statement – DML and DDL.

  • The Data Manipulation Language (DML).
  • SELECT – Select data from a database
  • UPDATE – Updates data in a database
  • DELETE – Delete data from a database
  • INSERT INTO – Inserts new data into a database.

  • The Data Definition Language (DDL).

read more

SQL (Structured Query Language)

  • SQL stands for Structured Query Language  


  • SQL lets you access and manipulate databases
    • SQL is a standard language for accessing databases.
    • SQL can execute queries against a database
    • SQL can retrieve data from a database
    • SQL can insert records in a database
    • SQL can update records in a database
    • SQL can delete records from a database
    • SQL can create new databases
    • SQL can create new tables in a database
    • SQL can create stored procedures in a database

    read more

TextBox Control in ASP.Net

ASP.Net TextBox Control - TextBox control is allow user to input some text to website. TextBox control is used to display textbox on asp.net web forms,

Image Control in ASP.Net

ASP.Net Image Control - Image control is used to display image on web page in asp.net. ImageUrl is used to describe the path of image.

ImageButton Control in ASP.Net

ASP.Net ImageButton Control - Imagebutton is a simple button control which allow us to write some server side code. Imagebutton looks like an image on web page in asp.net.

LinkButton Control in ASP.Net.

ASP.Net LinkButton Control - LinkButton is displayed same as link on web page, but it allow user to write some server code on linkbutton click events.

HyperLink Control in ASP.Net

ASP.Net HyperLink Control - HyperLink control is used to redirect user to other page in asp.net. In asp.net link one web forms to other using hyperlink control.