Professional Documents
Culture Documents
cs"
Inherits="_Default" Debug="false" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
#form1
{
font-weight: 700;
font-size: xx-large;
height: 46px;
width: 732px;
margin-left: 40px;
}
.style1
{
font-size: large;
height: 35px;
color: #FFFFFF;
}
</style>
</head>
<body background="loginbg2.jpg">
<form id="form1" runat="server">
<span lang="en-us" style="color:
#FFFFFF"> &n
bsp; &
nbsp;
DISPLAY OF DETAILS...</span><p>
</p>
<p class="style1">
Enter your Class Name(Table name) to display the Project details...
<asp:TextBox ID="TextBox1" runat="server" Height="39px"
ontextchanged="TextBox1_TextChanged" Width="195px"
BackColor="Transparent"
style="color: #FFFFFF"></asp:TextBox>
</p>
<p class="style1">
 
; &nbs
p; &nb
sp; &n
bsp;
</p>
<p class="style1">
 
; &nbs
p; &nb
sp; &n
bsp; &
nbsp;
 
;
<asp:Button ID="Button1" runat="server" Height="43px"
onclick="Button1_Click"
Text="Submit" Width="141px" BackColor="Transparent"
style="font-weight: 700; color: #FFFFFF; font-size: xx-large; font-
family: 'Segoe Print'" />
</p>
<p class="style1">
<asp:GridView ID="GridView1" runat="server" Height="315px" Width="520px"
BackColor="Black" style="color: #FFFFFF">
</asp:GridView>
</p>
</form>
</body>
</html>
cs file
using System;
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;
using System.Data.SqlTypes;
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string str = @"Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\USERS\SHRUT\DOCUMENTS\VISUAL STUDIO
2008\WEBSITES\DISCONNECT\APP_DATA\DATABASE.MDF;Initial
Catalog=C:\USERS\SHRUT\DOCUMENTS\VISUAL STUDIO
2008\WEBSITES\DISCONNECT\APP_DATA\DATABASE.MDF;Integrated Security=true;Connect
Timeout=30;User Instance=True";
SqlConnection conn = new SqlConnection(str);
SqlCommand cmd= new SqlCommand("Select * from " + TextBox1.Text, conn);
SqlDataAdapter sda=new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds, TextBox1.Text);
GridView1.DataSource = ds;
GridView1.DataBind();
}