ありがとう、私は助けが必要ですDBOperation dbo = new DBOperation();
.タイプまたは名前空間が見つからないというエラーがあります.
public partial class Survey : System.Web.UI.Page
{
public DataTable fillmydropdownlist()
{
DataTable drpdt = new DataTable();
SqlConnection con= new SqlConnection();
try
{
con.ConnectionString = @"SurveyFdBk_DB";
con.Open();
string q = "SELECT * FROM [Survey]";
SqlCommand cmd = new SqlCommand(q,con);
SqlDataAdapter da2 = new SqlDataAdapter(cmd);
return drpdt;
}
catch { }
finally{ con.Close(); }
}
protected void Page_Load(object sender, EventArgs e)
{
DBOperation dbo = new DBOperation();
DataTable dt = new DataTable();
dt = dbo.fillmydropdownlist();
DataTable drpdt= new DataTable();
if (dt.Rows.Count > 0)
{
DropDownList1.DataSource = drpdt;
DropDownList1.DataTextField="SurveyName";
DropDownList1.DataValueField="SurveyID";
DropDownList1.DataBind();
}
}
}