Пример #1
0
Файл: Table.cs Проект: Ojvar/ORM
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="parent"></param>
		/// <param name="name"></param>
		public Table (Database parent, string name, bool autoLoad = true) : base (C_Type, name, autoLoad)
		{
			if (null == parent)
				throw new NullReferenceException ("Parent is null!");

			setParent (parent);
		}
Пример #2
0
Файл: Table.cs Проект: Ojvar/ORM
		/// <summary>
		/// Set parent
		/// </summary>
		/// <param name="value"></param>
		public void setParent (Database value)
		{
			parent = value;
		}
Пример #3
0
		/// <summary>
		/// Refresh Table List
		/// </summary>
		void refreshTableList ()
		{
			if (null != currentConnection)
			{
				// Prepare Database
				currentDB	= new Database (currentConnection, initialCatalog);
				currentDB.loadTables ();

				// Show in grid
				if (tablesGrid.DataSource is DataTable)
					((DataTable)tablesGrid.DataSource).Dispose ();
				tablesGrid.DataSource	= tablesToDatatable (currentDB.getTables ());
			}
			else
				MessageBox.Show (this, "Connect to database", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
		}