当前位置: 首页 > news >正文

网站开发的目的相关书籍义乌设计网站

网站开发的目的相关书籍,义乌设计网站,做网站素材,服装织梦网站源码1、数据库配置xml#xff0c;首先连接成功后会自动创建xml并保存到对应xml#xff0c;如下 static string ConnPath AppDomain.CurrentDomain.BaseDirectory ConnOrcle.xml; 声明xml名称#xff0c;便于后续写入对应数据库参数 2、创建xml /// summar…1、数据库配置xml首先连接成功后会自动创建xml并保存到对应xml如下 static string ConnPath AppDomain.CurrentDomain.BaseDirectory ConnOrcle.xml; 声明xml名称便于后续写入对应数据库参数 2、创建xml /// summary         /// 创建XML节点         /// /summary         /// param nameip/param         /// param nameport/param         /// param namesid/param         /// param nameuser/param         /// param namepwd/param         public static void CreateXMLInform(string ip, string port, string sid, string user, string pwd)         {             XmlDocument xmlDoc new XmlDocument();             XmlDeclaration xmlDecl xmlDoc.CreateXmlDeclaration(1.0, utf-8, null);             xmlDoc.AppendChild(xmlDecl); XmlElement xe xmlDoc.CreateElement(Conn);//创建一个Conn节点 XmlElement xc1 xmlDoc.CreateElement(ConnIP);//IP             xc1.InnerText ip;             xe.AppendChild(xc1); XmlElement xc2 xmlDoc.CreateElement(ConnPort);//端口             xc2.InnerText port;             xe.AppendChild(xc2); XmlElement xc3 xmlDoc.CreateElement(ConnSid);//服务器名称             xc3.InnerText sid;             xe.AppendChild(xc3); XmlElement xc4 xmlDoc.CreateElement(ConnUser);//用户名             xc4.InnerText user;             xe.AppendChild(xc4); XmlElement xc5 xmlDoc.CreateElement(ConnPwd);//密码             xc5.InnerText pwd;             xe.AppendChild(xc5); xmlDoc.AppendChild(xe);             xmlDoc.Save(ConnPath);         } 3、声明连接类实体 ConnEntity private string connIP;//ip地址         private string connPort;//端口         private string connSid;//服务器名称         private string connUser;//用户名         private string connPwd;//密码 4、读取xml内容并赋值给ConnEntity /// summary         /// 读取XML内容赋值给连接         /// /summary         /// returns/returns         public static ConnEntityReadXML()         {             ConnEntity connentiy new ConnEntity();             if (File.Exists(ConnPath))             {                 XmlDocument xmlDoc new XmlDocument();                 xmlDoc.Load(ConnPath);                 XmlNodeList list xmlDoc.SelectSingleNode(Conn).ChildNodes;                 connentiy.ConnIP list[0].InnerText;                 connentiy.ConnPort list[1].InnerText;                 connentiy.ConnSid list[2].InnerText;                 connentiy.ConnUser list[3].InnerText;                 connentiy.ConnPwd list[4].InnerText;             }             return connentiy;         } 5、连接数据库测试 /// summary         /// 连接数据库         /// /summary         /// param nameip地址/param         /// param nameport端口/param         /// param namesid服务名称/param         /// param nameuser用户/param         /// param namepwd密码/param         public static bool ConnectionTestDB(string ip, string port, string sid, string user, string pwd)         {             ConnOracle(ip, port, sid, user, pwd);             try             {                 //不为空 并且 是关闭或者断了的情况下才连接                 if (Connection ! null (Connection.State System.Data.ConnectionState.Closed || Connection.State System.Data.ConnectionState.Broken))                 {                     Connection.Open();                     ReturnOwner Select(SELECT OWNER, TABLE_NAME FROM ALL_TAB_COMMENTS ORDER BY OWNER, TABLE_NAME);                 }                 MessageBox.Show(连接成功);                 return true;             }             catch (Exception ex)             {                 MessageBox.Show(“连接失败请检查数据库配置参数”ex.Message.ToString());                 return false;             }         } 6、其中调用的函数 /// /summary         /// param nameip地址/param         /// param nameport端口/param         /// param namesid服务名称/param         /// param nameuser用户/param         /// param namepwd密码/param         /// returnsOleDbConnection/returns         private static OracleConnection ConnOracle(string ip, string port, string sid, string user, string pwd)         {             string connStr;             connStr Data Source(DESCRIPTION (ADDRESS_LIST (ADDRESS (PROTOCOL TCP)(HOST ip )(PORT port ))) (CONNECT_DATA (SERVICE_NAME sid )));User ID user ;Password pwd ;;             Connection new OracleConnection(connStr);             return Connection;         } 详细看源码网址及下载 c#oracle创建实体类操作资源-CSDN文库
http://www.ho-use.cn/article/10817712.html

相关文章:

  • 济南企业建站公司适合夜里看的php
  • 宣武门网站建设wordpress网站在哪里修改
  • 网站怎么做修改莘县网站建设
  • 南京网站设公司西安旅游攻略知乎
  • 松江新城建设有限公司网站做商贸生意的人都去什么网站
  • 宿州产品网站建设aso推广方案
  • 网站开发商换了怎么在百度上面打广告
  • 南宁seo站内关键词优化个人微信网站怎么做
  • 合作建站方案建筑公司企业文化
  • 怎么查网站的所有权sqlite树莓派 wordpress
  • 网站优化的方法与技巧武威市市建设局网站建筑业管理
  • 自助建设wap网站中药材初加工平台
  • 保定网站制作价格自微网站
  • 搭建论坛网站建设手机银行官方网站
  • 温州seo网站推广wordpress 新建模板文件
  • 迁安做网站专业的聊城网站优化
  • 黄山网站建设怎么建自己的销售网站
  • 网站关键词一般设置几个山东济南seo整站优化公司
  • 网站域名在哪买中国建设银行网站首页 定投
  • 网站推广营销应该怎么做帮做非法网站
  • 开网络公司做网站挣钱么网站建设的财务计划
  • 南通做网站ntwsd外贸网站建设平台哪个好
  • nginx网站301重定向怎么做做网站的报价
  • 青岛网站如何制作厦门建设局官网首页
  • 焦作网站建设免费.net网站空间
  • 博客网站模板有哪些广州做大型网站建设
  • 怎样查网站谁做的wordpress tinymce
  • 个人网站页面模板做logo宣传语的网站
  • 朋友圈自己做的网站推广软文模板
  • 全国八大员报名官方网站做设计哪个网站可以接单