DISPLAYSTUDENT.ASPX.CS
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class DisplayUsers : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
SqlConnection con = new SqlConnection(DataBase.connect);
SqlDataAdapter da = new SqlDataAdapter("select * from Stud_Info", con);
SqlCommandBuilder cm = new SqlCommandBuilder(da);
DataSet ds = new DataSet();
da.Fill(ds, "Stud_Info");
if (ds.Tables["Stud_Info"].Rows.Count > 0)
{
GridView1.DataSource = ds.Tables["Stud_Info"];
GridView1.DataBind();
}
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
DISPLAYSTUDENT.ASPX
<%@ Page Language="C#" MasterPageFile="~/Hostel.master" AutoEventWireup="true" CodeFile="DisplayStudent.aspx.cs" Inherits="DisplayUsers" Title="DisplayStudent" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
height: 16px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table class="style1">
<tr>
<td align="center" colspan="2">
<asp:Label ID="Label1" runat="server" Text="Student Details" Font-Size="Medium"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style2" colspan="2">
<asp:Panel ID="Panel1" runat="server" ScrollBars="Both" Height="471px"
Width="682px">
<asp:GridView ID="GridView1" runat="server" BackColor="White"
BorderColor="#CC9966" BorderStyle="None"
BorderWidth="1px" CellPadding="4"
Height="467px" Width="682px"
onselectedindexchanged="GridView1_SelectedIndexChanged">
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</asp:Panel>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Back"
Width="151px" />
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
</asp:Content>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class DisplayUsers : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
SqlConnection con = new SqlConnection(DataBase.connect);
SqlDataAdapter da = new SqlDataAdapter("select * from Stud_Info", con);
SqlCommandBuilder cm = new SqlCommandBuilder(da);
DataSet ds = new DataSet();
da.Fill(ds, "Stud_Info");
if (ds.Tables["Stud_Info"].Rows.Count > 0)
{
GridView1.DataSource = ds.Tables["Stud_Info"];
GridView1.DataBind();
}
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
DISPLAYSTUDENT.ASPX
<%@ Page Language="C#" MasterPageFile="~/Hostel.master" AutoEventWireup="true" CodeFile="DisplayStudent.aspx.cs" Inherits="DisplayUsers" Title="DisplayStudent" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
height: 16px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table class="style1">
<tr>
<td align="center" colspan="2">
<asp:Label ID="Label1" runat="server" Text="Student Details" Font-Size="Medium"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td class="style2" colspan="2">
<asp:Panel ID="Panel1" runat="server" ScrollBars="Both" Height="471px"
Width="682px">
<asp:GridView ID="GridView1" runat="server" BackColor="White"
BorderColor="#CC9966" BorderStyle="None"
BorderWidth="1px" CellPadding="4"
Height="467px" Width="682px"
onselectedindexchanged="GridView1_SelectedIndexChanged">
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</asp:Panel>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Back"
Width="151px" />
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
</asp:Content>
Student Details | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0 comments:
Post a Comment