Hi all, I am displaying the all the data in gridview from database table. I have attached the database file in app folder. But after writing the while i am running the application getting error like "Cannot open database requested in login 'Employee'. Login fails. Login failed for user 'HOME-47F64BE31D\Administrator'."
Here is all my code:
aspx page:
aspx.cs: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) GetData();
}
private void GetData()
{
string str = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlDataAdapter da = new SqlDataAdapter("GetEmp", str);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}
Pls help me what is the error??
Thanks, Sumit