关于using CommonDataTool
程序:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CommonDataTool;
public class CompanyProduct
{
OleDbCommonTool objTool;
public CompanyProduct(string ConnString)
{
objTool = new OleDbCommonTool(ConnString);
}
//添加设备
public void addCompanyProduct(string Product_Name, string Product_Picture)
{
string Sql = "insert into Product(Product_Name,Product_Picture) values('" + Product_Name + "','" + Product_Picture + "')";
try
{
objTool.ExeNoQuery(Sql);
}
catch (Exception ce)
{
throw new Exception(ce.Message);
}
}
public void deleteProduct(int Product_ID)
{
string Sql = "delete from Product where Product_ID=" + Product_ID + "";
try
{
objTool.ExeNoQuery(Sql);
}
catch (Exception ce)
{
throw new Exception(ce.Message);
}
}
public DataSet executeNonQuery(string Sql)
{
try
{
return objTool.ExeDataSet(Sql);
}
catch
{
throw new Exception(Sql);
}
}
public DataSet productDisplay(string Sql)
{
string Conn = "select * from " + Sql + "";
try
{
return objTool.ExeDataSet(Conn);
}
catch
{
throw new Exception(Sql);
}
}
}
public partial class _Default : System.Web.UI.Page
{
CompanyProduct objProduct;
PagedDataSource objPage;
string ProductClass;
string sqlstring;
//CompanyTrend objTrend;
protected void Page_Load(object sender, EventArgs e)
{
ProductClass = Request.QueryString["Class"];
if (ProductClass == "MSL05")
{
sqlstring = "Product Where Product_Class='MSL05'";
this.btn_micro_PV.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "All")
{
sqlstring = "Product";
this.btn_all.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL01")
{
sqlstring = "Product Where Product_Class='MSL01'";
this.btn_solarLED.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL02")
{
sqlstring = "Product Where Product_Class='MSL02'";
this.btn_batLED.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL03")
{
sqlstring = "Product Where Product_Class='MSL03'";
this.btn_lawnlamp.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL06")
{
sqlstring = "Product Where Product_Class='MSL06'";
this.btn_PV_ctrl.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL-LED01")
{
sqlstring = "Product Where Product_Class='MSL-LED01'";
this.btn_LEDlamp.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL-LED02")
{
sqlstring = "Product Where Product_Class='MSL-LED02'";
this.btn_LEDbulb.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL-LED03")
{
sqlstring = "Product Where Product_Class='MSL-LED03'";
this.btn_alveolateLED.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL-LED04")
{
sqlstring = "Product Where Product_Class='MSL-LED04'";
this.btn_hpLED.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL-LED05")
{
sqlstring = "Product Where Product_Class='MSL-LED05'";
this.btn_otherLED.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else if (ProductClass == "MSL04")
{
sqlstring = "Product Where Product_Class='MSL04'";
this.btn_courtyard.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
else
{
sqlstring = "Product";
this.btn_all.BackColor = System.Drawing.Color.FromName("#80d3fa");
}
if (!IsPostBack)
{
BingDing(sqlstring);
}
}
public void BingDing(string mysql)
{
//this.ddlstTrend.DataSource = objTrend.trendDisplay("select top 5 * from CompanyTrend order by Companytrend_Time desc");
//this.ddlstTrend.DataBind();
string connString = ConfigurationManager.AppSettings["ConnString"].ToString() + Server.MapPath(ConfigurationManager.AppSettings["dbPath"].ToString());
objProduct = new CompanyProduct(connString);
objPage = new PagedDataSource();
objPage.AllowPaging = true;
objPage.PageSize = 6;
int curPage;
this.objPage.DataSource = objProduct.productDisplay(mysql).Tables[0].DefaultView;
if (Request.QueryString["page"] != null)
{
curPage = int.Parse(Request.QueryString["page"]);
}
else
{
curPage = 1;
}
objPage.CurrentPageIndex = curPage - 1;
//如果不是首条记录
if (!objPage.IsFirstPage)
{
this.HyperLink1.NavigateUrl = Request.CurrentExecutionFilePath + "?Class=" + ProductClass + "&" + "page=" + Convert.ToString(curPage - 1);
}
//如果不是最后一条记录
if (!objPage.IsLastPage)
{
this.HyperLink2.NavigateUrl = Request.CurrentExecutionFilePath + "?Class=" + ProductClass + "&" + "page=" + Convert.ToString(curPage + 1);
}
this.Label5.Text = "" + (objPage.CurrentPageIndex + 1);
this.Label6.Text = "" + objPage.PageCount;
this.ddlstProduct.DataSource = objPage;
this.ddlstProduct.DataBind();
}
protected void btn_micro_PV_Click(object sender, EventArgs e)
{
// string mysql;
// mysql = "Product Where Product_Class='MSL05'";
Response.Redirect("productDisplay.aspx?Class=MSL05");
}
protected void btn_all_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=All");
}
protected void btn_PV_ctrl_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL06");
}
protected void btn_solarLED_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL01");
}
protected void btn_batLED_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL02");
}
protected void btn_lawnlamp_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL03");
}
protected void btn_otherLED_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL-LED05");
}
protected void btn_hpLED_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL-LED04");
}
protected void btn_alveolateLED_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL-LED03");
}
protected void btn_LEDbulb_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL-LED02");
}
protected void btn_LEDlamp_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL-LED01");
}
protected void btn_courtyard_Click(object sender, EventArgs e)
{
Response.Redirect("productDisplay.aspx?Class=MSL04");
}
}
报错:
错误 1 找不到类型或命名空间名称“CommonDataTool”(是否缺少 using 指令或程序集引用?) F:\\company\fen.html\ProductDisplay\Default.aspx.cs 10 7 F:\...\ProductDisplay\
错误 2 找不到类型或命名空间名称“OleDbCommonTool”(是否缺少 using 指令或程序集引用?) F:\\company\fen.html\ProductDisplay\Default.aspx.cs 14 5 F:\...\ProductDisplay\
相关推荐
东华动物网 - Spring Bootstrap版本
Animal Portal 是一个由 JSP+JDBC 考试项目现代化重构而来的 Spring Boot 3.3.5 三层 MVC 应用。它采用标准分层架构:Controller 处理 HTTP 与视图、Service 封装业务规则与只读事务、Repository 基于 Spring Data JPA 做数据访问,配合 Thymeleaf 模板渲染,消除了旧版 Scriptlet 直连数据库的混乱。安全上引入 Spring Security 6,实现 BCrypt 密码哈希、表单登录、CSRF 防护与会话管理。数据库使用 MySQL 8(utf8mb4),首次启动自动建库建表并写入演示数据。配置通过 application.yml 与环境变量注入,支持 run.bat 一键启动并可指定端口。前端为原生 CSS/JS 自研设计系统,无外部 CDN、离线可用、响应式适配移动端。项目内置 10 个 MockMvc 集成测试,不依赖本机 MySQL 即可运行。
蓄电池+飞轮储能+风力发电+光伏MPPT的微电网混合储能功率协同控制仿真【仿真+配套复现的参考论文】
内容概要:本文详细介绍了一种基于粒子群优化(PSO)算法的微电网混合储能系统仿真模型,该系统集成蓄电池、飞轮储能、风力发电及光伏发电MPPT技术,重点实现多能源间的功率协同控制。通过Matlab/Simulink平台构建完整的仿真环境,结合配套可复现的参考论文,系统展示了在复杂微电网条件下,如何利用智能优化算法协调不同类型储能装置与间歇性可再生能源的出力特性,从而提升系统运行稳定性、能量利用率与动态响应性能。内容涵盖系统建模、控制策略设计、PSO优化机制嵌入、仿真测试与结果分析,突出科研级建模仿真方法的实际应用价值。; 适合人群:面向具备电力系统、新能源工程或自动化控制等相关专业背景,熟悉Matlab/Simulink仿真工具,从事微电网能量管理、混合储能控制、可再生能源并网等方向研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①用于微电网中多源多储系统的能量调度与功率分配策略研究;②支撑科研项目中混合储能协调控制算法的设计与验证;③辅助高水平学术论文的复现、改进与创新性优化算法开发; 阅读建议:建议结合提供的参考论文与仿真代码同步学习,重点关注PSO算法在实时功率优化中的实现逻辑,深入理解各子系统(如风电、光伏MPPT、蓄电池充放电、飞轮储能动态响应)的建模细节及其耦合接口机制,推荐动手调试参数、修改控制结构以深化对系统动态特性的掌握。
科技中介服务机构如何提升技术评估与需求匹配的智能化水平?.docx
科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。
风电、光伏与储能(含电池和废弃矿井小型抽水蓄能)互补调度运行研究(Matlab代码实现)
内容概要:本文系统研究了风电、光伏与多种储能形式(包括电池储能及利用废弃矿井构建的小型抽水蓄能系统)之间的互补调度运行机制,旨在应对新能源出力间歇性与波动性带来的挑战。通过Matlab平台编写代码,构建了多能源协同优化调度的数学模型,并引入粒子群优化算法(PSO)等智能优化方法求解,以实现系统运行的经济性、可靠性与新能源高比例消纳。研究重点涵盖风光发电的不确定性建模、储能系统的精细化充放电策略、废弃矿井抽水蓄能的特殊地理与工程约束建模,以及多能互补的动态协调调度逻辑,最终形成一套完整的仿真优化框架。; 适合人群:面向具备电力系统分析、可再生能源利用或自动化控制等相关专业背景,熟悉Matlab/Simulink编程环境,且正在从事新能源并网、微电网或综合能源系统研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①用于风光储多能互补系统的仿真建模与优化算法开发;②支撑高水平学术论文撰写、学位论文研究或实际工程项目的技术论证;③深入掌握基于智能优化算法的能源系统协同调度方法与实现路径。; 阅读建议:建议结合文末所附参考文献,循序渐进地理解系统建模思想与算法设计逻辑,重点剖析Matlab代码的实现细节,并推荐使用Simulink进行动态仿真,以验证所提出调度策略在不同工况下的有效性与鲁棒性。
CISP-CSE注册云安全工程师备考资源包
CISP-CSE注册云安全工程师备考资源包


