这一段代码,求高手帮忙看一下
数据层是:namespace DAL
{
public class ManageInfoDal
{
private SQLHelper sqlhelper = null;
public ManageInfoDal()
{
sqlhelper = new SQLHelper();
}
public DataTable GetManageInfo(string Plcid)
{
string sql = "select * from [mission] where [Plcid] = '"+Plcid+"' ";
try
{
DataTable dt = sqlhelper.ExecuteQuery(sql, CommandType.Text);
return dt;
}
catch (Exception ee)
{
throw ee;
}
}
public bool UpdateInfo(ComputerInfo cif, string id)
{
string sql = "UPDATE newssystem.dbo.mission SET TaskName='" + cif.TaskName + "',Units='" + cif.Units + "',StartTime='" + cif.StartTime + "',EndTime='" + cif.EndTime + "',Content='" + cif.Content + "' WHERE Plcid='" + cif.Plcid + "'and id='" + id + "'";
try
{
int n = sqlhelper.ExecuteNonQuery(sql, CommandType.Text);
if (n>0)
{
return true;
}
else
{
return false;
}
}
catch (Exception ex)
{
return false;
}
}
}
}
业务层是:
namespace BLL
{
public class ManageInfoBll
{
private ManageInfoDal mid = new ManageInfoDal();
public DataTable GetComputerInfoByMan(string Plcid)
{
try
{
DataTable dt = mid.GetManageInfo(Plcid);
return dt;
}
catch (Exception ee)
{
throw ee;
}
}
public bool UpdateComputer(ComputerInfo cif, string id)
{
try
{
bool alyreadyup = mid.UpdateInfo(cif, id);
return alyreadyup;
}
catch (Exception ex)
{
return false;;
}
}
}
}
事件:
public partial class Manage : System.Web.UI.Page
{
public string gcode = "";
protected void Page_Load(object sender, EventArgs e)
{
gcode = Request["xcode"];
if (!IsPostBack && !IsCallback)
{
if (Session["user"] != null)
{
ManageInfoBll mib = new ManageInfoBll();
DataTable dt = mib.GetComputerInfoByMan(gcode);
this.GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
Response.Redirect("default.aspx");
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
报"**"附近有语法错误