Posts
Showing posts with the label ASP.NET
How to make databse connectivity in ASP.NET?
- Get link
- Other Apps
Please add the follwoing code in you sample.cs page. Step 1 : Add Namspace "using System.Data.SqlClient;" Step 2 : Make Sql connection. SqlConnection con = new SqlConnection("Server=You server name or comp name; Database=Yourdatabasename;Trusted_Connectopn=True"); SqlCommand cmd = new SqlCommand("select * from Table name"); con.Open(); DataSet ds = new DataSet(cmd,con); SqlDataAdapter da = new SqlDataAdapter(); da.Fill(ds); con.Close();
ASP.NET Life Cycle
- Get link
- Other Apps
Page_Init --> LoadViewState --> LoadPostData --> Page_Load --> RaisePostDataChangedEvent --> RaisePostBackEvent --> Page_PreRender --> SaveViewState --> Page_Render --> Page_UnLoad Page_load Event guarantees that all controls are fully loaded. In Page_Init events controls are also accessed but you will see that view state is not fully loaded during this event.