⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmdatabaseexplorer.cs

📁 这是用C#数据库编程的实例
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace databrowser
{
	/// <summary>
	/// frmDatabaseExplorer 的摘要说明。
	/// </summary>
	public class frmDatabaseExplorer : System.Windows.Forms.Form
	{
		private System.Windows.Forms.ListView listView1;
		private System.Windows.Forms.TreeView treeView1;
		private System.Windows.Forms.ContextMenu contextMenu1;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;
		private String m_sConnectString;
		//存放链接
		public String ConnectionString
		{
			//定义只读链接属性
			get
			{
				return m_sConnectString;
				//取得链接字符串
			}
			set
			{
				m_sConnectString=value;
			}
		}
		public frmDatabaseExplorer()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
		}
		public frmDatabaseExplorer(ref String userName
			,ref String password,ref String database,ref String SQLServer)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		public bool buildTreeView()
		{
			return true;
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.listView1 = new System.Windows.Forms.ListView();
			this.treeView1 = new System.Windows.Forms.TreeView();
			this.contextMenu1 = new System.Windows.Forms.ContextMenu();
			this.SuspendLayout();
			// 
			// listView1
			// 
			this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.listView1.Name = "listView1";
			this.listView1.Size = new System.Drawing.Size(488, 317);
			this.listView1.TabIndex = 3;
			// 
			// treeView1
			// 
			this.treeView1.Dock = System.Windows.Forms.DockStyle.Left;
			this.treeView1.ImageIndex = -1;
			this.treeView1.Name = "treeView1";
			this.treeView1.SelectedImageIndex = -1;
			this.treeView1.Size = new System.Drawing.Size(168, 317);
			this.treeView1.TabIndex = 2;
			// 
			// frmDatabaseExplorer
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(488, 317);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.treeView1,
																		  this.listView1});
			this.Name = "frmDatabaseExplorer";
			this.Text = "frmDatabaseExplorer";
			this.ResumeLayout(false);

		}
		#endregion
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -