-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMoviesList.aspx.cs
46 lines (42 loc) · 1.12 KB
/
MoviesList.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
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DBProject.DAL;
using System.Data;
using System.Text;
namespace DBProject
{
public partial class MoviesList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SearchMovies(sender, e);
}
protected void SearchMovies(object sender, EventArgs e)
{
myDAL objmyDAl = new myDAL();
DataTable DT= new DataTable();
int found;
found = objmyDAl.BrowseAllMovies(ref DT);
if (found != 1)
{
Message.Text = "There was some error!";
}
else
{
MoviesGrid.DataSource = DT;
if (DT.Rows.Count > 0)
{
Message.Text = "Following movies are found:";
MoviesGrid.DataBind();
}
else
{
Message.Text = "No Movies Found:";
}
}
}
}
}