关于字符串处理得问题
stringSQL="selectEmployee_DutyidfromUserInfowhereUser_Name='"+HttpUtility.UrlDecode(R...
string SQL = "select Employee_Dutyid from UserInfo where User_Name='" + HttpUtility.UrlDecode(Request.Cookies["username"].Value.ToString()) + "'";
DataTable mydt = Class1.ExecSel(SQL);
string caozuo_project =mydt.Rows[0]["Employee_Dutyid"].ToString();
string[] split = caozuo_project.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
string sql = "select a.Module_Url,a.Operation_name from Function_module a where a.Module_type='咨询数据' and a.Role_Id in ('"+caozuo_project+"')";
SqlDataAdapter adapter = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
con.Close();
adapter.Fill(ds);
adapter.Dispose();
DataTable dt = ds.Tables[0];
if (dt.Rows.Count > 0)
{
this.Repeater1.DataSource =dt;
this.Repeater1.DataBind();
}
else
{
// this.labpage.Text = "当前没有记录";
}
Employee_Dutyid 数据类型是varchar,Role_Id是Int
{6,7,8} ——>{“6”,"7”,"8”} 怎么实现啊
{6,7,8} ——>{“6”,"7”,"8”} 怎么实现啊
这个是一朋友的建议,结果是错误的
string a
a="/""+a.Repare(",","/",/"")+"/""; 展开
DataTable mydt = Class1.ExecSel(SQL);
string caozuo_project =mydt.Rows[0]["Employee_Dutyid"].ToString();
string[] split = caozuo_project.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
string sql = "select a.Module_Url,a.Operation_name from Function_module a where a.Module_type='咨询数据' and a.Role_Id in ('"+caozuo_project+"')";
SqlDataAdapter adapter = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
con.Close();
adapter.Fill(ds);
adapter.Dispose();
DataTable dt = ds.Tables[0];
if (dt.Rows.Count > 0)
{
this.Repeater1.DataSource =dt;
this.Repeater1.DataBind();
}
else
{
// this.labpage.Text = "当前没有记录";
}
Employee_Dutyid 数据类型是varchar,Role_Id是Int
{6,7,8} ——>{“6”,"7”,"8”} 怎么实现啊
{6,7,8} ——>{“6”,"7”,"8”} 怎么实现啊
这个是一朋友的建议,结果是错误的
string a
a="/""+a.Repare(",","/",/"")+"/""; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询