public partial class _Default : System.Web.UI.Page { SqlConnection con = new SqlConnection("Server=dimts-022;Initial Catalog=db_asset;User=UserName;password=Password"); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BindData(); } } public void BindData() { try { con.Open(); SqlDataAdapter da = new SqlDataAdapter("select * from b_asset_master", con); DataTable ds = new DataTable(); da.Fill(ds); Grid.DataSource = ds; Grid.DataBind(); } catch { Label1.Text = "No records Found"; Label1.Visible = true; } finally { con.Close(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)