错误 1 运算符“!=”无法应用于“int”和“string”类型的操作数 应该怎么改,新手提问谢谢
if(FNewsID!=""){stringCmdText="select*from[TNews_category]whereNewsID=@FNewsID";SqlPa...
if (FNewsID != "")
{
string CmdText = "select * from [TNews_category] where NewsID=@FNewsID";
SqlParameter para = new SqlParameter("@FNewsID", FNewsID);
SqlDataReader Sdr = DB.GetDataReader(CmdText, para);
while (Sdr.Read())
{
this.FNewsID = (int)Sdr["NewsID"];
this.FNewsName = Sdr["NewsName"].ToString();
}
}
else
{
FNewsID = 0;
FNewsName = "";
}
} 展开
{
string CmdText = "select * from [TNews_category] where NewsID=@FNewsID";
SqlParameter para = new SqlParameter("@FNewsID", FNewsID);
SqlDataReader Sdr = DB.GetDataReader(CmdText, para);
while (Sdr.Read())
{
this.FNewsID = (int)Sdr["NewsID"];
this.FNewsName = Sdr["NewsName"].ToString();
}
}
else
{
FNewsID = 0;
FNewsName = "";
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询