<connectionStrings> <add name="=ConStr" connectionString="Data Source=DESKTOP-HL3PK63; Database=ASP_Database; User Id=sa; Password=123" providerName="System.Data.SqlClient"/> </connectionStrings>
public partial class WebForm1 : System.Web.UI.Page { SqlConnection cn = null; SqlCommand cmd = null; SqlDataAdapter da = null; DataSet ds = null; string strsqlCommand = string.Empty; protected void Page_Load(object sender, EventArgs e) { cn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConStr"].ConnectionString); if (!Page.IsPostBack) { BindRepeaterData(); } } protected void BindRepeaterData() { strsqlCommand = "Select * from Comment Order By PostedDate Desc"; da = new SqlDataAdapter(strsqlCommand, cn); ds = new DataSet(); da.Fill(ds); Repeater1.DataSource = ds; Repeater1.DataBind(); }
<add name="=ConStr"
=
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)