using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string StrConn = WebConfigurationManager.ConnectionStrings["Database"].ConnectionString;
SqlConnection Conn = new SqlConnection(StrConn);
Conn.Open();
string sqlProduct;
sqlProduct = " Select iddog,namedog,agedog FROM dog ";
SqlDataAdapter da = new SqlDataAdapter(sqlProduct, Conn);
DataSet ds = new DataSet();
da.Fill(ds, "dog");
GridView1.DataSource = ds.Tables["dog"];
GridView1.DataBind();
}
}
ตรงต้วหนา ค่ะ ฟ้อง Error
Code
The name 'WebConfigurationManager' does not exist in the current context
ช่วยหน่อยนะคะ
Tag : .NET, Ms SQL Server 2005, Ms SQL Server 2008, C#