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

📄 procedures.cs

📁 非常实用的NET的SQL 程序
💻 CS
📖 第 1 页 / 共 2 页
字号:
namespace StoredProcs
{
    using System;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.WinForms;
	using System.Data;
	using System.Data.SQL;
	using System.Data.ADO;
	using System.Text;
	using System.Diagnostics;

    /// <summary>
    ///			This program was written mainly as a response to a comment made by my boss 
    ///			in regaurds to a similar program which was written in Visual Basic.  The 
    ///			original VB Version helped us find an error while on project. Joe teasingly 
    ///			asked me "What? You did not write it in C#? This inspired me to do it in C#,
    ///			and doing so actually learned a great deal about the framework and the objects 
    ///			contained therein.
    /// </summary>
    /// <remarks>
    ///			Author: Timothy A. Vanover MCP, MCT, MCSD, MCDBA
    /// </remarks>
	/// <remarks>
    ///			Date:	12/15/2000
    /// </remarks>
    public class Procedures : System.WinForms.Form
    {
        /// <summary>
        ///    Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components;
		private System.WinForms.RadioButton rbSelect;
		private System.WinForms.RadioButton rbOther;
		private System.WinForms.ToolTip toolTip1;
		private System.WinForms.Button btnExecute;
		private System.WinForms.Label lblCount;
		private System.WinForms.Label label6;
		private System.WinForms.Button btnProcNames;
		private System.WinForms.ListBox lstProcs;
		private System.WinForms.Label label5;
		private System.WinForms.TextBox txtUser;
		private System.WinForms.TextBox txtServer;
		private System.WinForms.TextBox txtDataBase;
		private System.WinForms.TextBox txtPassword;
		private System.WinForms.Label label4;
		private System.WinForms.Label label3;
		private System.WinForms.Label label2;
		private System.WinForms.Button btnInfo;
		private System.WinForms.DataGrid datReturn;
		private System.WinForms.DataGrid datInfo;

        public Procedures()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        ///    Clean up any resources being used.
        /// </summary>
        public override void Dispose()
        {
            base.Dispose();
            components.Dispose();
        }

        /// <summary>
        ///    Required method for Designer support - do not modify
        ///    the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager (typeof(Procedures));
			this.components = new System.ComponentModel.Container ();
			this.rbSelect = new System.WinForms.RadioButton ();
			this.lstProcs = new System.WinForms.ListBox ();
			this.txtDataBase = new System.WinForms.TextBox ();
			this.label2 = new System.WinForms.Label ();
			this.lblCount = new System.WinForms.Label ();
			this.txtUser = new System.WinForms.TextBox ();
			this.txtServer = new System.WinForms.TextBox ();
			this.btnProcNames = new System.WinForms.Button ();
			this.datReturn = new System.WinForms.DataGrid ();
			this.label4 = new System.WinForms.Label ();
			this.label5 = new System.WinForms.Label ();
			this.rbOther = new System.WinForms.RadioButton ();
			this.btnInfo = new System.WinForms.Button ();
			this.datInfo = new System.WinForms.DataGrid ();
			this.toolTip1 = new System.WinForms.ToolTip (this.components);
			this.btnExecute = new System.WinForms.Button ();
			this.label3 = new System.WinForms.Label ();
			this.label6 = new System.WinForms.Label ();
			this.txtPassword = new System.WinForms.TextBox ();
			datReturn.BeginInit ();
			datInfo.BeginInit ();
			//@this.TrayHeight = 90;
			//@this.TrayLargeIcon = false;
			//@this.TrayAutoArrange = true;
			rbSelect.Checked = true;
			rbSelect.Location = new System.Drawing.Point (304, 216);
			rbSelect.Text = "Select Procedure";
			rbSelect.Size = new System.Drawing.Size (112, 16);
			rbSelect.FlatStyle = System.WinForms.FlatStyle.Flat;
			rbSelect.TabIndex = 8;
			rbSelect.TabStop = true;
			lstProcs.Location = new System.Drawing.Point (424, 168);
			lstProcs.Size = new System.Drawing.Size (160, 119);
			lstProcs.BorderStyle = System.WinForms.BorderStyle.FixedSingle;
			lstProcs.TabIndex = 9;
			txtDataBase.Location = new System.Drawing.Point (96, 200);
			txtDataBase.Text = "pubs";
			txtDataBase.BorderStyle = System.WinForms.BorderStyle.FixedSingle;
			txtDataBase.TabIndex = 1;
			txtDataBase.Size = new System.Drawing.Size (112, 20);
			label2.Location = new System.Drawing.Point (24, 176);
			label2.Text = "Server Name";
			label2.Size = new System.Drawing.Size (80, 16);
			label2.TabIndex = 6;
			lblCount.Location = new System.Drawing.Point (312, 168);
			lblCount.Text = "0";
			lblCount.Size = new System.Drawing.Size (32, 16);
			lblCount.TabIndex = 17;
			txtUser.Location = new System.Drawing.Point (96, 232);
			txtUser.Text = "sa";
			txtUser.BorderStyle = System.WinForms.BorderStyle.FixedSingle;
			txtUser.TabIndex = 2;
			txtUser.Size = new System.Drawing.Size (112, 20);
			txtServer.Location = new System.Drawing.Point (96, 168);
			txtServer.Text = "Developer";
			txtServer.BorderStyle = System.WinForms.BorderStyle.FixedSingle;
			txtServer.TabIndex = 0;
			txtServer.Size = new System.Drawing.Size (112, 20);
			btnProcNames.Location = new System.Drawing.Point (224, 198);
			btnProcNames.FlatStyle = System.WinForms.FlatStyle.Flat;
			btnProcNames.Size = new System.Drawing.Size (64, 24);
			btnProcNames.TabIndex = 4;
			btnProcNames.Text = "List";
			btnProcNames.Click += new System.EventHandler (this.btnProcNames_Click);
			btnProcNames.MouseHover += new System.EventHandler (this.btnProcNames_OnMouseHover);
			datReturn.Location = new System.Drawing.Point (24, 304);
			datReturn.HeaderForeColor = System.Drawing.Color.Black;
			datReturn.LinkHoverColor = System.Drawing.Color.RoyalBlue;
			datReturn.CaptionBackColor = System.Drawing.Color.DarkSlateBlue;
			datReturn.SelectionForeColor = System.Drawing.Color.White;
			datReturn.Size = new System.Drawing.Size (560, 136);
			datReturn.BorderStyle = System.WinForms.BorderStyle.FixedSingle;
			datReturn.HeaderBackColor = System.Drawing.Color.DarkGray;
			datReturn.LinkColor = System.Drawing.Color.DarkSlateBlue;
			datReturn.ParentRowsBackColor = System.Drawing.Color.Black;
			datReturn.DataMember = "";
			datReturn.ForeColor = System.Drawing.Color.Black;
			datReturn.SelectionBackColor = System.Drawing.Color.DarkSlateBlue;
			datReturn.ParentRowsForeColor = System.Drawing.Color.White;
			datReturn.FlatMode = true;
			datReturn.TabIndex = 11;
			datReturn.CaptionForeColor = System.Drawing.Color.White;
			datReturn.CaptionFont = new System.Drawing.Font ("Tahoma", 8);
			datReturn.BackColor = System.Drawing.Color.Gainsboro;
			datReturn.AlternatingBackColor = System.Drawing.Color.Gainsboro;
			datReturn.GridLineColor = System.Drawing.Color.White;
			label4.Location = new System.Drawing.Point (24, 272);
			label4.Text = "Password";
			label4.Size = new System.Drawing.Size (56, 16);
			label4.TabIndex = 8;
			label5.Location = new System.Drawing.Point (24, 240);
			label5.Text = "User ID";
			label5.Size = new System.Drawing.Size (64, 16);
			label5.TabIndex = 13;
			rbOther.Location = new System.Drawing.Point (304, 192);
			rbOther.Text = "Other Procedure";
			rbOther.Size = new System.Drawing.Size (112, 16);
			rbOther.FlatStyle = System.WinForms.FlatStyle.Flat;
			rbOther.TabIndex = 7;
			btnInfo.Location = new System.Drawing.Point (224, 230);
			btnInfo.FlatStyle = System.WinForms.FlatStyle.Flat;
			btnInfo.Size = new System.Drawing.Size (64, 24);
			btnInfo.TabIndex = 5;
			btnInfo.Enabled = false;
			btnInfo.Text = "View";
			btnInfo.Click += new System.EventHandler (this.btnInfo_Click);
			btnInfo.MouseHover += new System.EventHandler (this.btnInfo_OnMouseHover);
			datInfo.Location = new System.Drawing.Point (24, 24);
			datInfo.HeaderForeColor = System.Drawing.Color.Black;
			datInfo.LinkHoverColor = System.Drawing.Color.RoyalBlue;
			datInfo.CaptionBackColor = System.Drawing.Color.DarkSlateBlue;
			datInfo.SelectionForeColor = System.Drawing.Color.White;
			datInfo.Size = new System.Drawing.Size (560, 136);
			datInfo.BorderStyle = System.WinForms.BorderStyle.FixedSingle;
			datInfo.HeaderBackColor = System.Drawing.Color.DarkGray;
			datInfo.LinkColor = System.Drawing.Color.DarkSlateBlue;
			datInfo.AllowSorting = false;
			datInfo.ParentRowsBackColor = System.Drawing.Color.Black;
			datInfo.DataMember = "";
			datInfo.ForeColor = System.Drawing.Color.Black;
			datInfo.SelectionBackColor = System.Drawing.Color.DarkSlateBlue;
			datInfo.ParentRowsForeColor = System.Drawing.Color.White;
			datInfo.FlatMode = true;
			datInfo.TabIndex = 10;
			datInfo.CaptionForeColor = System.Drawing.Color.White;
			datInfo.CaptionFont = new System.Drawing.Font ("Tahoma", 8);
			datInfo.BackColor = System.Drawing.Color.Gainsboro;
			datInfo.AlternatingBackColor = System.Drawing.Color.Gainsboro;
			datInfo.GridLineColor = System.Drawing.Color.White;
			//@toolTip1.SetLocation (new System.Drawing.Point (7, 7));
			toolTip1.AutoPopDelay = 2000;
			toolTip1.Active = true;
			toolTip1.InitialDelay = 500;
			toolTip1.ReshowDelay = 100;
			btnExecute.Location = new System.Drawing.Point (224, 262);
			btnExecute.FlatStyle = System.WinForms.FlatStyle.Flat;
			btnExecute.Size = new System.Drawing.Size (64, 24);
			btnExecute.TabIndex = 6;
			btnExecute.Enabled = false;
			btnExecute.Text = "Execute";
			btnExecute.Click += new System.EventHandler (this.btnExecute_Click);
			btnExecute.MouseHover += new System.EventHandler (this.btnExecute_OnMouseHover);
			label3.Location = new System.Drawing.Point (24, 208);
			label3.Text = "Data Base";
			label3.Size = new System.Drawing.Size (88, 16);
			label3.TabIndex = 7;
			label6.Location = new System.Drawing.Point (224, 168);
			label6.Text = "Parameter Count:";
			label6.Size = new System.Drawing.Size (96, 16);
			label6.TabIndex = 16;
			txtPassword.Location = new System.Drawing.Point (94, 264);
			txtPassword.Text = "password";
			txtPassword.BorderStyle = System.WinForms.BorderStyle.FixedSingle;
			txtPassword.TabIndex = 3;
			txtPassword.Size = new System.Drawing.Size (114, 20);
			this.Text = "Procedures";
			this.StartPosition = System.WinForms.FormStartPosition.CenterScreen;
			this.AutoScaleBaseSize = new System.Drawing.Size (5, 13);
			this.BorderStyle = System.WinForms.FormBorderStyle.FixedToolWindow;
			this.Icon = (System.Drawing.Icon) resources.GetObject ("$this.Icon");
			this.ClientSize = new System.Drawing.Size (610, 482);
			this.Controls.Add (this.rbSelect);
			this.Controls.Add (this.rbOther);
			this.Controls.Add (this.btnExecute);
			this.Controls.Add (this.lblCount);
			this.Controls.Add (this.label6);
			this.Controls.Add (this.btnProcNames);
			this.Controls.Add (this.lstProcs);
			this.Controls.Add (this.label5);
			this.Controls.Add (this.txtUser);
			this.Controls.Add (this.txtServer);
			this.Controls.Add (this.txtDataBase);
			this.Controls.Add (this.txtPassword);
			this.Controls.Add (this.label4);
			this.Controls.Add (this.label3);
			this.Controls.Add (this.label2);
			this.Controls.Add (this.btnInfo);
			this.Controls.Add (this.datReturn);
			this.Controls.Add (this.datInfo);
			datReturn.EndInit ();
			datInfo.EndInit ();

⌨️ 快捷键说明

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