-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNews.aspx.cs
More file actions
24 lines (23 loc) · 814 Bytes
/
News.aspx.cs
File metadata and controls
24 lines (23 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class Default2 : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DatabaseConnectionString1"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter adpt = new SqlDataAdapter("SELECT [id], [tag], [title], [writer_name], [news_image], [writer_image] FROM [manage_news]", con);
DataTable dt = new DataTable();
adpt.Fill(dt);
Repeater1.DataSource = dt;
Repeater1.DataBind();
Repeater2.DataSource = dt;
Repeater2.DataBind();
}
}