<%@Import Namespace="System.Data"%> <%@Import Namespace="System.Data.SqlClient"%> <%@Page Language="C#" Debug="true" %> <script runat="server" language="c#"> void Page_Load(object sender,EventArgs e) { if (!IsPostBack) { BindGridview(); } } void BindGridview() { SqlConnection con = new SqlConnection("Data Source=JDPANDEY-PC;Integrated Security=true;Initial Catalog=GridViewTesting"); con.Open(); SqlCommand cmd = new SqlCommand("select * from User", con); SqlDataAdapter da = new SqlDataAdapter(cmd); con.Close(); DataSet ds = new DataSet(); da.Fill(ds); gvrecords.DataSource = ds; gvrecords.DataBind(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)