为什么出现这种提示: 20

usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingS... using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Data.Common;
using System.Data.SqlClient;

public partial class todayData : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strConn="Data Source=hao-pc;Initial Catalog=simpleBBS;Persist Security Info=True;User ID=sa;Password=123";
System.Data.Common.DbProviderFactory dbProviderFactory=System.Data.Common.DbProviderFactories.GetFactory("System.Data.SqlClient");
System.Data.Common.DbConnection dbConn=dbProviderFactory.CreateConnection();
dbConn.ConnectionString=strConn;
dbConn.Open();
DbDataAdapter dbDataAdapter=dbProviderFactory.CreateDataAdapter();
DbCommand dbComm=dbProviderFactory.CreateCommand();
dbComm.CommandText="Select * from information";
dbComm.Connection=dbConn;
dbDataAdapter.SelectCommand=dbComm;
DataSet dsDataSet=new DataSet();
dbDataAdapter.Fill(dsDataSet,"information");

DataTable dtTable=new DataTable();
DataColumn newColumn=new DataColumn();

newColumn.ColumnName="date"; //显示"Invalid token'=' in class struct or interface member declaration"
newColumn.DataType=System.Type.GetType("System.String");
newColumn.AutoIncrement=false;
newColumn.ReadOnly=true;
newColumn.Unique=true;
dtTable.Columns.Add(newColumn);

newColumn=new DataColumn();
newColumn.ColumnName="numbers";
newColumn.DataType=System.Type.GetType("System.Int32");
newColumn.AutoIncrement=false;
newColumn.ReadOnly=true;
newColumn.Unique=false; //can it been skipped?
dtTable.Columns.Add(newColumn);

newColumn=new DataColumn();
newColumn.ColumnName="percentage";
newColumn.DataType=System.Type.GetType("Sytstem.String");
newColumn.AutoIncrement=false;
newColumn.ReadOnly=true;
newColumn.Unique=false;
dtTable.Columns.Add(newColumn);
DataRow newRow;
for(int i=0;i<24;i++)
{
newRow=dtTable.NewRow();
newRow["date"]=i+":00--"+(i+1)+":00";
newRow["numbers"]=timeCome[i];
if(dayCome!=0)
{
newRow["percentage"]=((float)timeCome[i]/dayCome*100+"%";
}
else
newRow["percentage"]="nobody";
dtTable.Rows.Add(newRow);
}
GridView1.DataSource=dtTable;
GridView1.DataBind();

}
在浏览器中的错误提示:
Compiler Error Message: CS1519: Invalid token '=' in class, struct, or interface member declaration

Source Error:

Line 59: DataColumn newColumn=new DataColumn();
Line 60:
Line 61: newColumn.ColumnName="[date]";
Line 62: newColumn.DataType=System.Type.GetType("System.String");
Line 63: newColumn.AutoIncrement=false;

Source File: c:\Users\hao\Documents\Visual Studio 2008\qiMing2\todayData.aspx.cs Line: 61
展开
 我来答
百度网友94f02eb
2008-02-14 · TA获得超过8613个赞
知道大有可为答主
回答量:7955
采纳率:74%
帮助的人:4519万
展开全部
newColumn.ColumnName="[date]"; //显示"Invalid token'=' in class struct or interface member
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
yizusong
2008-02-14 · TA获得超过3045个赞
知道大有可为答主
回答量:4516
采纳率:0%
帮助的人:4497万
展开全部
啥提示?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式