-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactor.aspx.cs
48 lines (43 loc) · 1.2 KB
/
actor.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Configuration;
using System.Text;
using System.Data;
public partial class actor : System.Web.UI.Page
{
SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["LeAvServer"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData(1);
}
}
private void LoadData(int page)
{
try
{
cn.Open();
SqlCommand cmd = new SqlCommand("GetAllActor", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@page", SqlDbType.Int).Value = page;
SqlDataAdapter ad = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
ad.Fill(ds);
actorRepeater.DataSource = ds.Tables[0];
actorRepeater.DataBind();
}
catch (Exception ex)
{ }
finally
{
cn.Close();
}
}
}