无法将类型“string”隐式转换为“int”
代码如下,不明白C#干嘛喜欢把东西转来转去的,事项一次觉得技术先进吗?!!!!!!!
public partial class TrainManage_Train_TrainRecord : System.Web.UI.Page
{
private int xT_ID = "sid";//培训ID 报错这一句无法将类型“string”隐式转换为“int”
private string DutySql = "select a.P_ID,a.P_NAME, case a.P_SEX when 0 then '男' when 1 then '女' when 2 then '未知'end as P_SEX ,a.P_DEPARTMENT,c.RP_RESULT,c.RP_PEROSN_ID,c.RP_TRAIN_ID,b.T_ID,b.T_NAME,b.T_START_TIME,b.T_OVER_TIME,d.INFO_ID,d.INFO_NAME from RS_Person a,RS_TRAIN b,RS_TRAIN_PERSON c, RS_D_INFOMATION d where a.P_ID = c.RP_PEROSN_ID and b.T_ID = c.RP_TRAIN_ID and d.INFO_ID=a.P_DEPARTMENT and b.T_ID='xT_ID' ";//这句SQL语句查处3表里的数据。
private class _Notice
{
public static string RecordCount;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//int xID = Convert.ToInt32(Request.QueryString["id"]);
//int id = Int32.Parse(this.Request.QueryString["id"]);//编号
int sid = Int32.Parse(this.Request.QueryString["id"].ToString());
Response.Write(sid);
这里可以得出 sid的值 得出为8 而且我觉得这里已经 int 了。。哪里也没看到类型“string”隐式 这都什么跟什么错啊。