这是源码:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace OpencloseDB
{ public partial class kaiqi :System.Web.UI.Page
{
protected void Button1_Click(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue.ToString() == "")
{
Response.Write("<script>alert('请选择操作机器!');</script>");
}
else
{//更新语句
string sql = string.Format("update TbCollector set gprst= 1 where CollectNo={0},DropDownList.SelectedValue.ToString()");
int result = 0;
try
{
SqlCommand command = new SqlCommand(sql, DBhelper.connection);
DBhelper.connection.open();
result = command.ExecuteNonquery();
}
catch (Exception ex)
{
}
finally
{
DBhelper.connection.close();
}
if (result < 1)
{
Response.Write("<script>alert('开启成功!');</script>");
}
else
{
Response.Write("<script>alert('开启失败!');</script>");
}
} }
protected void Button2_Click(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue.ToString() == "")
{
Response.Write("<script>alert('请选择操作机器!');</script>");
}
else
{//更新语句
string sql = string.Format("update TbCollector set gprst= 0 where CollectNo={0},DropDownList.SelectedValue.ToString()");
int result = 0;
try
{
SqlCommand command = new SqlCommand(sql, DBhelper.connection);
DBhelper.connection.open();
result = command.ExecuteNonquery();
}
catch (Exception ex)
{
}
finally
{
DBhelper.connection.close();
}
if (result < 1)
{
Response.Write("<script>alert('关闭成功!');</script>");
}
else
{
Response.Write("<script>alert('关闭失败!');</script>");
}
} }
}
}错误提示:
错误 2 “ASP.kaiqi_aspx.GetTypeHashCode()”: 没有找到适合的方法来重写 c:\Users\xj\AppData\Local\Temp\Temporary ASP.NET Files\website2\2a8bc898\841d5049\App_Web_oi4odi5p.2.cs 481
错误 3 “ASP.kaiqi_aspx.ProcessRequest(System.Web.HttpContext)”: 没有找到适合的方法来重写 c:\Users\xj\AppData\Local\Temp\Temporary ASP.NET Files\website2\2a8bc898\841d5049\App_Web_oi4odi5p.2.cs 486
错误 4 “ASP.kaiqi_aspx”不实现接口成员“System.Web.IHttpHandler.IsReusable” c:\Users\xj\AppData\Local\Temp\Temporary ASP.NET Files\website2\2a8bc898\841d5049\App_Web_oi4odi5p.2.cs 150
错误 1 请确保此代码文件中定义的类与“inherits”属性匹配,并且该类扩展的基类(例如 Page 或 UserControl)是正确的。 D:\WebSite2\kaiqi.aspx.cs 19 33 D:\WebSite2\
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace OpencloseDB
{ public partial class kaiqi :System.Web.UI.Page
{
protected void Button1_Click(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue.ToString() == "")
{
Response.Write("<script>alert('请选择操作机器!');</script>");
}
else
{//更新语句
string sql = string.Format("update TbCollector set gprst= 1 where CollectNo={0},DropDownList.SelectedValue.ToString()");
int result = 0;
try
{
SqlCommand command = new SqlCommand(sql, DBhelper.connection);
DBhelper.connection.open();
result = command.ExecuteNonquery();
}
catch (Exception ex)
{
}
finally
{
DBhelper.connection.close();
}
if (result < 1)
{
Response.Write("<script>alert('开启成功!');</script>");
}
else
{
Response.Write("<script>alert('开启失败!');</script>");
}
} }
protected void Button2_Click(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue.ToString() == "")
{
Response.Write("<script>alert('请选择操作机器!');</script>");
}
else
{//更新语句
string sql = string.Format("update TbCollector set gprst= 0 where CollectNo={0},DropDownList.SelectedValue.ToString()");
int result = 0;
try
{
SqlCommand command = new SqlCommand(sql, DBhelper.connection);
DBhelper.connection.open();
result = command.ExecuteNonquery();
}
catch (Exception ex)
{
}
finally
{
DBhelper.connection.close();
}
if (result < 1)
{
Response.Write("<script>alert('关闭成功!');</script>");
}
else
{
Response.Write("<script>alert('关闭失败!');</script>");
}
} }
}
}错误提示:
错误 2 “ASP.kaiqi_aspx.GetTypeHashCode()”: 没有找到适合的方法来重写 c:\Users\xj\AppData\Local\Temp\Temporary ASP.NET Files\website2\2a8bc898\841d5049\App_Web_oi4odi5p.2.cs 481
错误 3 “ASP.kaiqi_aspx.ProcessRequest(System.Web.HttpContext)”: 没有找到适合的方法来重写 c:\Users\xj\AppData\Local\Temp\Temporary ASP.NET Files\website2\2a8bc898\841d5049\App_Web_oi4odi5p.2.cs 486
错误 4 “ASP.kaiqi_aspx”不实现接口成员“System.Web.IHttpHandler.IsReusable” c:\Users\xj\AppData\Local\Temp\Temporary ASP.NET Files\website2\2a8bc898\841d5049\App_Web_oi4odi5p.2.cs 150
错误 1 请确保此代码文件中定义的类与“inherits”属性匹配,并且该类扩展的基类(例如 Page 或 UserControl)是正确的。 D:\WebSite2\kaiqi.aspx.cs 19 33 D:\WebSite2\
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货