C# 预处理器指令必须显示为行中的第一个非空白字符
我发现错误C# 预处理器指令必须显示为行中的第一个非空白字符,c#,C#,我发现错误预处理器指令必须作为行中的第一个非空白字符出现。我需要在代码中更改什么才能使其正常工作 protected void Button3_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.AddRange(new DataColumn[21] { new DataColumn("Siebel_SR#"), new DataC
预处理器指令必须作为行中的第一个非空白字符出现。
我需要在代码中更改什么才能使其正常工作
protected void Button3_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[21] { new DataColumn("Siebel_SR#"),
new DataColumn("Siebel_SR#1"), new DataColumn("Tran_Qty"), new DataColumn("Ord_Sou_Ref"),
new DataColumn("Tran_Reference"), new DataColumn("[Ord Number]"), new DataColumn("[Ord Number1]"),
new DataColumn("Transaction_Type_Id"), new DataColumn("Trans_Date"), new DataColumn("[Trans Sub]"),
new DataColumn("Business"), new DataColumn("New_DFF_SR#"), new DataColumn("Reason_Name"),
new DataColumn("Line_Type"), new DataColumn("Org"), new DataColumn("Sub_Inv"), new DataColumn("Part_Num"),
new DataColumn("[Last Updated By]"), new DataColumn("[Created By]"), new DataColumn("Employee"), new DataColumn("DateWorked") });
foreach (GridViewRow row in GridView1.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
CheckBox chk = (row.Cells[0].FindControl("chkSelect") as CheckBox);
if (chk.Checked)
{
string Siebel_SR# = row.Cells[2].Text;
string Tran_Qty = row.Cells[3].Text;
string Ord_Sou_Ref= row.Cells[4].Text;
string Tran_Reference = row.Cells[5].Text;
string Transaction_Type_Id = row.Cells[8].Text;
string Trans_Date = row.Cells[9].Text;
string Business = row.Cells[11].Text;
string Reason_Name = row.Cells[13].Text;
string Line_Type = row.Cells[14].Text;
string Org = row.Cells[15].Text;
string Sub_Inv = row.Cells[16].Text;
string Part_Num = row.Cells[17].Text;
string Employee = row.Cells[20].Text;
string DateWorked = row.Cells[21].Text;
dt.Rows.Add( Tran_Qty ,Ord_Sou_Ref , Tran_Reference , Transaction_Type_Id, Trans_Date ,
Business , Reason_Name ,Line_Type , Org , Sub_Inv , Part_Num , Employee , DateWorked );
}
}
}
GridView3.DataSource = dt;
GridView3.DataBind();
}
C#预处理器指令以
开头,例如#if
#define
#region
等。每个指令都必须在自己的行上。即使在评论前面加上评论也会产生这种错误
例如:
/* some comment*/ #region SOMETHING
#endregion
将给出此错误,因为
#region
前面不能有任何内容(可能除了空格)。编辑您的帖子并提出您的问题,如果可能的话,请指出您的错误。还有,给你的编程语言贴上这个标签。我不禁想知道,一个人在没有学习如何提问的基础知识的情况下如何获得2K的声誉?这可能有助于C#预处理器指令:@hyde:那不是我,我的一个朋友发布了这个问题。C#甚至不是我的工作,我是一名iOS开发人员。@Ankur,我不确定如果负责任地进行帐户共享,对帐户共享有何看法,但考虑到帐户是如何自由创建的,即使不创建帐户,你也可以问一个问题,你的这位朋友是如何不知道帐户共享的基本行为的,在让他们再次使用你的帐户之前,我会教育他们一点……当然,没问题。只需单击“接受”按钮,我们将称之为偶数;)