Posts

Showing posts from May, 2012

Sample Code For DataBase Connection Using Asp.net

        protected void Page_Load( object sender, EventArgs e)         {              SqlCommand MyCommand;                SqlDataAdapter MyAdapter;                DataTable MyTable;             SqlConnection MyConnection;             MyConnection = new SqlConnection ();             MyConnection.ConnectionString = "Data Source=B406DCOK;Initial  Catalog=Akhil;Integrated Security=True" ;               MyCommand = new SqlCommand ();      ...

What is Web Services

Web services are used to retrieve datas from servers. Through the webservices we are transfering discription of some amount of datas that we have to retrieve. According to that information the datas are retrieving from the web.                                We can also use the webservices to retrieve the datas from the database also from a front end. It is very effective if we are using the webservices to retrieve the informations that, others can access the same webservices to retrieve the informations with out writing the code for that again and again.

How to display datas in a gridview in asp.net.

     data is taking from table table_3         protected void Page_Load( object sender, EventArgs e)         {              SqlCommand MyCommand;                SqlDataAdapter MyAdapter;                DataTable MyTable;             SqlConnection MyConnection;             MyConnection = new SqlConnection ();             MyConnection.ConnectionString = "Data   Source=B406DCOK;Initial      Catalog=Akhil;Integrated  Security=True" ;           ...

How to select second largest value from a table

It is easier to select second largest field from a table . Syntax :    Select * from table_name where column_name = (select MAX(column_Name) from table_name where column_name=(select MAX(column_name) from table_name)) Example:  If we are going to select the second largest field from a table "table_2" according to the value in the field Subscriber_HCID . Means we are going to select the entire row from a table having the Subscriber_HCID should be the second largest select * from t1 where id =( select MAX ( id ) from t1 where id <( select MAX ( id ) from t1 ))