本文介绍了我无法将单个值绑定到Datasource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
string AdmissinNo = Request.QueryString["admissionno"];
int chart = 0;
chart = BAL.BL.meanData(AdmissinNo);
int meanLanguage1 = Convert.ToInt32(chart / 40);
现在我在这里得到meanLanguage1的值是11,我想把这个值加到Datasource
Now here i'm getting the value of meanLanguage1 is 11,i want to add this value to Datasource
Chart1.DataSource = chart;
Chart1.Series["Series1"].XValueMember = "Language1";
Chart1.Series["Series1"].YValueMembers = "MIN";
但是我像是这样的错误...... / b $ b
数据源是无效的类型。它必须是IListSource,IEnumerable或IDataSource。
请帮我解决这个问题。
but i'm gaetting the error like
Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource.
please help me to solve this problem.
推荐答案
DataTable DBTable = New DataTable() ;
string AdmissinNo = Request.QueryString["admissionno"];
DataColumn dc = new DataColumn("Admissionno");
DBTable.Columns.Add(dc);
DBTable.Rows[0]["Admissionno"] = AdmissinNo;
Chart1.DataSource = DBTable;
Chart1.Series["Series1"].XValueMember = "Language1";
Chart1.Series["Series1"].YValueMembers = "MIN";
这篇关于我无法将单个值绑定到Datasource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!