Click here to Skip to main content
Click here to Skip to main content
 

Using PostgreSQL in your C# (.NET) application (An introduction)

By , 15 Nov 2008
 
afppostsrc.zip
PostgreSQLTEst
MultiCtrls.dll
PostgreSQLTEst
bin
obj
Release
PostgreSQLTEst.exe
PostgreSQLTEst.csproj.user
Properties
Settings.settings
namespace PostgreSQLTEst
{
	partial class Form1
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (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.dataGridView1 = new System.Windows.Forms.DataGridView();
			this.tbHost = new MultiCtrls.LabeledTextBox();
			this.tbPort = new MultiCtrls.LabeledTextBox();
			this.tbUser = new MultiCtrls.LabeledTextBox();
			this.tbPass = new MultiCtrls.LabeledTextBox();
			this.tbDataBaseName = new MultiCtrls.LabeledTextBox();
			this.llOpenConnAndSelect = new System.Windows.Forms.LinkLabel();
			((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
			this.SuspendLayout();
			// 
			// dataGridView1
			// 
			this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.dataGridView1.Location = new System.Drawing.Point(12, 96);
			this.dataGridView1.Name = "dataGridView1";
			this.dataGridView1.Size = new System.Drawing.Size(629, 347);
			this.dataGridView1.TabIndex = 0;
			// 
			// tbHost
			// 
			this.tbHost.LabelText = "Host adress";
			this.tbHost.Location = new System.Drawing.Point(98, 12);
			this.tbHost.Name = "tbHost";
			this.tbHost.offset = 5;
			this.tbHost.Size = new System.Drawing.Size(100, 20);
			this.tbHost.TabIndex = 1;
			// 
			// tbPort
			// 
			this.tbPort.LabelText = "Port";
			this.tbPort.Location = new System.Drawing.Point(98, 38);
			this.tbPort.Name = "tbPort";
			this.tbPort.offset = 5;
			this.tbPort.Size = new System.Drawing.Size(100, 20);
			this.tbPort.TabIndex = 4;
			// 
			// tbUser
			// 
			this.tbUser.LabelText = "User";
			this.tbUser.Location = new System.Drawing.Point(301, 12);
			this.tbUser.Name = "tbUser";
			this.tbUser.offset = 5;
			this.tbUser.Size = new System.Drawing.Size(100, 20);
			this.tbUser.TabIndex = 6;
			// 
			// tbPass
			// 
			this.tbPass.LabelText = "Password";
			this.tbPass.Location = new System.Drawing.Point(541, 12);
			this.tbPass.Name = "tbPass";
			this.tbPass.offset = 5;
			this.tbPass.Size = new System.Drawing.Size(100, 20);
			this.tbPass.TabIndex = 7;
			// 
			// tbDataBaseName
			// 
			this.tbDataBaseName.LabelText = "Database name";
			this.tbDataBaseName.Location = new System.Drawing.Point(301, 38);
			this.tbDataBaseName.Name = "tbDataBaseName";
			this.tbDataBaseName.offset = 5;
			this.tbDataBaseName.Size = new System.Drawing.Size(100, 20);
			this.tbDataBaseName.TabIndex = 10;
			// 
			// llOpenConnAndSelect
			// 
			this.llOpenConnAndSelect.AutoSize = true;
			this.llOpenConnAndSelect.Location = new System.Drawing.Point(441, 45);
			this.llOpenConnAndSelect.Name = "llOpenConnAndSelect";
			this.llOpenConnAndSelect.Size = new System.Drawing.Size(200, 13);
			this.llOpenConnAndSelect.TabIndex = 11;
			this.llOpenConnAndSelect.TabStop = true;
			this.llOpenConnAndSelect.Text = "Open connection and bake simple select";
			this.llOpenConnAndSelect.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llOpenConnAndSelect_LinkClicked);
			// 
			// Form1
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(662, 455);
			this.Controls.Add(this.llOpenConnAndSelect);
			this.Controls.Add(this.tbDataBaseName);
			this.Controls.Add(this.tbPass);
			this.Controls.Add(this.tbUser);
			this.Controls.Add(this.tbPort);
			this.Controls.Add(this.tbHost);
			this.Controls.Add(this.dataGridView1);
			this.Name = "Form1";
			this.Text = "Form1";
			((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		private System.Windows.Forms.DataGridView dataGridView1;
		private MultiCtrls.LabeledTextBox tbHost;
		private MultiCtrls.LabeledTextBox tbPort;
		private MultiCtrls.LabeledTextBox tbUser;
		private MultiCtrls.LabeledTextBox tbPass;
		private MultiCtrls.LabeledTextBox tbDataBaseName;
		private System.Windows.Forms.LinkLabel llOpenConnAndSelect;
	}
}

By viewing downloads associated with this article you agree to the Terms of use 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, along with any associated source code and files, is licensed under The BSD License

About the Author

Adrian Pasik
Software Developer AP-System
Poland Poland
Member
Born in Kielce, Poland in 1983
 
Back in the days i programmed C++ projects for pure fun. In 2000 i was administrator of one network with 128 kbit bandwidth to the internet. Since we couldnt afford Microsoft NT software for our server i dived into the fantastic world of FLOSS. I started interesting in security of computing and of course did some reasearch in that field. Later on i did few commercial projects in PHP and MySQL. Soon after that i drop MySQL in order to store my data in PostgreSQL. Did also few exec's of OpenGL + GLSL to know what my graphics card is capable of. Started C#( and generally went back to Windows programming) in early 2007 and feeling this trend will last for some time...
 
Since begining of 2010 i work as an independent contractor.
 
I specialize at C#, mostly in Win Forms. I have some knowledge of ASP.NET but so far i didnt have some exciting project in this technology.
 
Speaking of 3rd party components I have been with DevExpress and I recommend it, except of the productivity plugins which are in my humble opinion not so good, but You will find people that like them.
If You want good productivity plugin, use Jetbrains ReSharper.
 
I'm fan of TDD since early 2011.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 15 Nov 2008
Article Copyright 2008 by Adrian Pasik
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid