<td align="center"> <asp:LinkButton ID="viewdata" runat="server" onclick="viewdata_Click"> viewdata</asp:LinkButton> <br /> <asp:GridView ID="GridView1" runat="server"> </asp:GridView> </td>
protected void viewdata_Click(object sender, EventArgs e)//Code to View //// the data from the SQL Server { SqlConnection conn = new SqlConnection("user id=sa;" + "password=prodip@km;server=PRODIP;" + "Trusted_Connection=yes;" + "database=Member;"); try { SqlDataAdapter sda = new SqlDataAdapter("select * from emp", conn); DataSet ds = new DataSet(); sda.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)