denotes a 'field' where a 'class' was expected
jeg har et asp.net projekt hvor jeg fylder en dropdown boks ud fra et datasetmen jeg får den her fejl:
'dstproto.WebForm1.yearDrop' denotes a 'field' where a 'class' was expected
koden er her:
string ConnStr = System.Configuration.ConfigurationSettings.AppSettings.Get("connStr");
MySqlConnection Conn = new MySqlConnection(ConnStr);
Conn.Open();
string SelectStr = "SELECT name,description,file,dstid,year FROM statistik WHERE dstid = '"+dstid+"' ORDER BY statid DESC";
MySqlDataAdapter statAdapter = new MySqlDataAdapter(SelectStr, ConnStr);
DataSet statSet = new DataSet();
statAdapter.Fill(statSet, "statistik");
Conn.Close();
yearDrop.DataSource = statSet.Tables[0];
yearDrop.DataValueField = "statid";
yearDrop.DataTextField = "year";
yearDrop.DataBind();
