Click here to Skip to main content
15,885,032 members
Articles / Programming Languages / C#

DBLayer Wizard V 1.0

,
Rate me:
Please Sign up or sign in to vote.
3.42/5 (22 votes)
8 Nov 20052 min read 75K   1.5K   51  
DBLayer Wizard is a code generator that generates Data Layer classes in C# using ADO.NET and SQL Server 2000.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace SampleApp
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class MainForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.Button btninlineSql;
		private System.Windows.Forms.Button btnSP;
		private System.Windows.Forms.Button btnTransaction;
		private System.Windows.Forms.Button btnSelect;
		private System.Windows.Forms.Button btnInsert;
		private System.Windows.Forms.Button button1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

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

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.panel1 = new System.Windows.Forms.Panel();
			this.btninlineSql = new System.Windows.Forms.Button();
			this.btnSP = new System.Windows.Forms.Button();
			this.btnTransaction = new System.Windows.Forms.Button();
			this.btnSelect = new System.Windows.Forms.Button();
			this.btnInsert = new System.Windows.Forms.Button();
			this.button1 = new System.Windows.Forms.Button();
			this.panel1.SuspendLayout();
			this.SuspendLayout();
			// 
			// panel1
			// 
			this.panel1.Controls.Add(this.btninlineSql);
			this.panel1.Controls.Add(this.btnSP);
			this.panel1.Controls.Add(this.btnTransaction);
			this.panel1.Controls.Add(this.btnSelect);
			this.panel1.Controls.Add(this.btnInsert);
			this.panel1.Controls.Add(this.button1);
			this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
			this.panel1.Location = new System.Drawing.Point(0, 0);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(152, 398);
			this.panel1.TabIndex = 3;
			// 
			// btninlineSql
			// 
			this.btninlineSql.Location = new System.Drawing.Point(16, 16);
			this.btninlineSql.Name = "btninlineSql";
			this.btninlineSql.Size = new System.Drawing.Size(120, 32);
			this.btninlineSql.TabIndex = 4;
			this.btninlineSql.Text = "Execute in-Line SQL";
			this.btninlineSql.Click += new System.EventHandler(this.btninlineSql_Click);
			// 
			// btnSP
			// 
			this.btnSP.Location = new System.Drawing.Point(16, 56);
			this.btnSP.Name = "btnSP";
			this.btnSP.Size = new System.Drawing.Size(120, 32);
			this.btnSP.TabIndex = 5;
			this.btnSP.Text = "Execute Stored Procedure";
			this.btnSP.Click += new System.EventHandler(this.btnSP_Click);
			// 
			// btnTransaction
			// 
			this.btnTransaction.Location = new System.Drawing.Point(16, 96);
			this.btnTransaction.Name = "btnTransaction";
			this.btnTransaction.Size = new System.Drawing.Size(120, 32);
			this.btnTransaction.TabIndex = 6;
			this.btnTransaction.Text = "Execute Transaction";
			this.btnTransaction.Click += new System.EventHandler(this.btnTransaction_Click);
			// 
			// btnSelect
			// 
			this.btnSelect.Location = new System.Drawing.Point(16, 144);
			this.btnSelect.Name = "btnSelect";
			this.btnSelect.Size = new System.Drawing.Size(120, 32);
			this.btnSelect.TabIndex = 1;
			this.btnSelect.Text = "Select from Table";
			this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
			// 
			// btnInsert
			// 
			this.btnInsert.Location = new System.Drawing.Point(16, 184);
			this.btnInsert.Name = "btnInsert";
			this.btnInsert.Size = new System.Drawing.Size(120, 32);
			this.btnInsert.TabIndex = 2;
			this.btnInsert.Text = "Table Operations";
			this.btnInsert.Click += new System.EventHandler(this.btnInsert_Click);
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(16, 360);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(120, 32);
			this.button1.TabIndex = 3;
			this.button1.Text = "About Us";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// MainForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(672, 398);
			this.Controls.Add(this.panel1);
			this.IsMdiContainer = true;
			this.Name = "MainForm";
			this.Text = "DBLayer Sample Application";
			this.panel1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new MainForm());
		}

		private void ShowChildDialog(Form dlg)
		{
			dlg.FormBorderStyle=FormBorderStyle.None;
			dlg.ShowInTaskbar=false;
			//dlg.WindowState=FormWindowState.Maximized;
			dlg.MdiParent=this;
			dlg.ControlBox=false;
			dlg.MaximizeBox=false;
			dlg.MinimizeBox=false;
			dlg.Show();
			dlg.Dock=DockStyle.Fill;
			
		}

		private void btninlineSql_Click(object sender, System.EventArgs e)
		{
			ExecSQL dlg=new ExecSQL();
			ShowChildDialog(dlg);
		}

		private void btnSP_Click(object sender, System.EventArgs e)
		{
			ExecSP dlg=new ExecSP();
			ShowChildDialog(dlg);
		}

		private void btnTransaction_Click(object sender, System.EventArgs e)
		{
			ExecTransaction dlg=new ExecTransaction();
			ShowChildDialog(dlg);
		}

		private void btnSelect_Click(object sender, System.EventArgs e)
		{
			TableSelect dlg=new TableSelect();
			ShowChildDialog(dlg);
		}

		private void btnInsert_Click(object sender, System.EventArgs e)
		{
			TableOperations dlg=new TableOperations();
			ShowChildDialog(dlg);
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
		
		}


	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Austria Austria
Egyption ,B.Sc in computer science Department from faculty of computer science and information system Egypt-Helwan Univeristy ,
my master in progress in intelligent systems in Vienna Technology university ,
Microsoft Certified Professional science 2003 experience with
Turbo Pascal ,C++,VC++,C#,VB.NET,J# ,asp,ASP.Net,COM+ & XML , sql server 2000,action script 2

Written By
Web Developer
Egypt Egypt
I have B.Sc in Computer Science , Microsoft Certified Solution Developer and experienced with C/C++,MFC,C#,VB.NET,ASP.NET,XML,SQL Server 2000 & Crystal Reports.I like challenge and enjoy working with new technologies.

Comments and Discussions