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; public partial class _Default : System.Web.UI.Page { SqlConnection conn = new SqlConnection("Data Source=IBM_M3;Initial Catalog=Hospital;Persist Security Info=True;User ID=sa;Password=hhtpa"); protected void Page_Load(object sender, EventArgs e) { conn.Open();//the error is coming here SqlDataAdapter da = new SqlDataAdapter("select * from viewData",conn); conn.Close(); DataSet ds = new DataSet(); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)