登录
首页 » C# » C# 设计模式示例大全(源码下载)

C# 设计模式示例大全(源码下载)

于 2016-06-07 发布
0 83
下载积分: 1 下载次数: 0

代码说明:

C# 设计模式示例大全(源码下载)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 静态页判断验证码是否输入正确
    静态页判断验证码是否输入正确
    2013-11-28下载
    积分:1
  • webbrowser控件自定义开发
    制作自己的浏览器
    2015-01-22下载
    积分:1
  • C#连接数据库(SQL Server,MySQL,Microsoft Access,DB2,Oracle)连接字符串
    C#/.NET项目开发过程中,特别是中大型的项目,跟数据库打交道那是再正常不过的事情了。数据库可以帮助我们保存和管理数据。C#/.NET的项目中,我们也可以使用不同的数据库。 那么,我们今天就来总结整理一下C#/.NET的连接各类主流数据库(SQL Server,MySQL,Microsoft Access,DB2,Oracle)的连接字符串。 一、C#/.NET连接Microsoft SQL Server 1. 使用ODBC数据库连接 // ODBC标准连接 using System.Data.Odbc; OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={SQL Server}; Server=ServerName; DataBase=DataBaseName; Uid=UserName; Pwd=password"; conn.Open();   // ODBC受信任的连接 using System.Data.Odbc; OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={SQL Server}; Server=ServerName; DataBase=DataBaseName; Uid=admin; Pwd=password";  conn.Open();   // 或者 OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={SQL Server}; Server=ServerName; DataBase=DataBaseName; Trusted_Connection=Yes;";  2.使用OLEDB // OleDb标准连接 using System.Data.OleDb; OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Driver=SQLOLEDB; Data Source=ServerName; Initial Catalog=DataBaseName; User id=UserName; Password=Secret;";  conn.Open(); // OleDb受信任的连接 using System.Data.OleDb; OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Driver=SQLOLEDB; Data Source=ServerName; Initial Catalog=DataBaseName; Integrated Security=SSPI;";  conn.Open(); 3.使用.Net DataProvider // .NET DataProvider标准连接 using System.Data.SqlClient; SqlConnection conn = new SqlDbConnection(); conn.ConnectionString ="Data Source=ServerName; Initial Catalog=DataBaseName; User id=UserName; Password=Secret;";  conn.Open(); Data Source=DESKTOP-AC9DHQ6;Initial Catalog=MyKTV;Persist Security Info=True;User ID=sa;Password=mdg456123   // .NET DataProvider受信任连接 using System.Data.SqlClient; SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source=ServerName; Initial Catalog=DataBaseName; Integrated Security=SSPI;";  conn.Open(); 二、C#/.NET连接Microsoft Access 1.使用ODBC连接 // ODBC标准连接 using System.Data.Odbc; OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; Dbq=c:myPathmyDb.mdb; Uid=Admin; Pwd=;password";  conn.Open();   // ODBC工作组(Workgroup)连接 using System.Data.Odbc; OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; Dbq=c:myPathmyDb.mdb; SystemDb=c:myPathmyDb.mdw;";  conn.Open(); 2.使用OLEDB连接 // 使用OleDb的Jet标准安全连接 using System.Data.OleDb; OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:mypathmyDb.mdb; User id=admin;Password=password"; conn.Open(); // 使用OleDb的Jet System Database连接 using System.Data.OleDb; OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:mypathmyDb.mdb; System Database=c:mypathmyDb.mdw"; conn.Open(); 三、C#/.NET连接MySQL数据库 1.使用ODBC数据源连接 // ODBC使用MyODBC Driver的远程数据库连接 using System.Data.Odbc;  OdbcConnection conn = new OdbcConnection();  conn.ConnectionString = "Driver={MySql}; Server=192.168.0.10; Option=131072; Port=3306; Stmt=; DataBase=DataBaseName; Uid=UserName; Pwd=password;" ; conn.Open(); 2.使用OLEDB连接 // OleDb标准连接 using System.Data.OleDb; OleDbConnection conn = new OleDbConnection();  conn.ConnectionString = "Provider=MySqlProv; Data Source=ServerName; User id=UserName; Password=Password"; conn.Open(); 四、C#/.NET连接DB2数据库 1.使用ODBC连接 // 不带DSN的ODBC连接 using System.Data.Odbc; OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={IBM DB2 ODBC DRIVER};DataBase=DataBaseName; HostName=ServerName; Protocol=TCPIP;Port=PortNumber;Uid=UserName;Pwd=Secret";  conn.Open(); 2.使用OLEDB连接 // OleDb微软官方驱动 using System.Data.OleDb; OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Driver=DB2OLEDB; Network Transport Library=TCPIP; Network Address=xxx.xxx.xxx.xxx; Package Collection=CollectionName; Initial Catalog=DataBaseName; User id=UserName; Password=Secret;";  conn.Open(); // OleDb IBM 驱动 using System.Data.OleDb; OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Driver=IBMDADB2; DataBase=DataBaseName; HostName=ServerName; Protocol=TCPIP; Port=PortNumber; Uid=UserName; Pwd=Secret;";  conn.Open(); 3.使用.Net DataProvider第三方驱动 // 来自IBM的.NET DataProvider using IBM.Data.DB2; Db2Connection conn = new Db2Connection(); conn.ConnectionString = "DataBase=DataBaseName;Uid=UserName;Pwd=Secret"; conn.Open(); 五、C#/.NET连接Oracle数据库 1.使用ODBC连接 // ODBC 微软的官方驱动 using System.Data.Odbc; OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=UserName;Pwd=Secret;";  conn.Open(); // ODBC Oracle的驱动 using System.Data.Odbc; OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={Oracle ODBC Driver};Dbq=myDataBase;Uid=UserName;Pwd=Secret;";  conn.Open(); 2.使用OLEDB连接 // OleDb:Oracle驱动的标准连接 using System.Data.OleDb; OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Driver=OraOLEDB.Oracle;Data Source=ServerName;User id=UserName;Password=Secret;"; conn.Open(); // OleD:Oracle驱动的受信任连接 using System.Data.OleDb; OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Driver=OraOLEDB.Oracle;Data Source=ServerName;OSAuthent=1;"; conn.Open(); // 或者写成  using System.Data.OleDb; OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Driver=OraOLEDB.Oracle;Data Source=ServerName;User id=admin;Password=pwd";  conn.Open();  
    2021-08-07 00:31:00下载
    积分:1
  • 百度网盘资源搜索 实例源码下载
    百度网盘资源搜索 实例源码下载
    2014-07-08下载
    积分:1
  • C# 自定义OpenFileDialog 实例源码下载
    自定义OpenFileDialog
    2013-10-03下载
    积分:1
  • c++ 俄罗斯方块 游戏源码下载
    c++ 俄罗斯方块 游戏源码下载
    2015-04-02下载
    积分:1
  • C#控制雷赛驱动器单轴点位运动
    C#控制雷赛驱动器单轴点位运动
    2020-11-29下载
    积分:1
  • C#+Unity3d休闲跳跃游戏
    基于unity3d引擎的创意休闲跳跃游戏
    2019-07-19下载
    积分:1
  • 用C#.NET实现删除指定文件
    用C#.NET实现删除指定文件
    2013-10-31下载
    积分:1
  • 企业短信猫 群发短信示例源码(含dllforvc.dll)
    企业短信猫 群发短信示例源码(含dllforvc.dll)
    2018-04-06下载
    积分:1
  • 696518资源总数
  • 104269会员总数
  • 31今日下载