当前位置: 首页>>代码示例>>C#>>正文


C# ISchema.GetTables方法代码示例

本文整理汇总了C#中ISchema.GetTables方法的典型用法代码示例。如果您正苦于以下问题:C# ISchema.GetTables方法的具体用法?C# ISchema.GetTables怎么用?C# ISchema.GetTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISchema的用法示例。


在下文中一共展示了ISchema.GetTables方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnGetTables_Click

        private void btnGetTables_Click(object sender, EventArgs e)
        {
            //////////////////////////////////////////////////////////
            //TODO: Dynamically load provider specific assemblies
            //NOTE: There seems to be a bug in the way .NET loads
            //assemblies in the GAC, so dynamic loading of an assembly
            //does not work for me right now. Need to investigate

            //string assemblyName =
            //	ConfigurationSettings.AppSettings
            //	["SALAssembly"];
            //string typeName = "com.common.sal.schema.SqlSchema";
            //Assembly.Load("SqlSchema");
            //////////////////////////////////////////////////////////

            string connection;
            connection = "Server=" + txtServer.Text + ";Database=" + txtDatabase.Text +
                ";User ID=" + txtUser.Text + ";Password=" + txtPass.Text;

            //schema = Assembly.Load( assemblyName ).CreateInstance( typeName ) as ISchema;
            schema = new SqlSchema( connection ) as ISchema;
            if( schema != null ) {
                //List user tables
                try {
                    schema.Populate();
                    DataTableCollection dtc = schema.GetTables();
                    foreach( DataTable dt in dtc ) {
                        lbTables.Items.Add( dt );
                    }

                    //Alphabetical order
                    lbTables.Sorted = true;
                }
                catch( SchemaException se ) {
                    MessageBox.Show( se.Message, "SchemaException");
                }
            }
        }
开发者ID:BackupTheBerlios,项目名称:dbdiff-svn,代码行数:38,代码来源:DbReporter.cs

示例2: Schemas_OnSelectionChanged

        private void Schemas_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ClearSchema();

            if (null == Schemas.SelectedValue)
                return;

            var schemaName = Schemas.SelectedValue.ToString();

            if (String.IsNullOrEmpty(schemaName))
                return;

            _currentSchema = _currentProject.GetSchema(schemaName);

            Tables.ItemsSource = _currentSchema.GetTables();
        }
开发者ID:ternaryalchemy,项目名称:MergeUi,代码行数:16,代码来源:MergeUi.xaml.cs

示例3: Schemas_OnSelectionChanged

        private void Schemas_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (null == Schemas.SelectedValue)
                    return;

                var schemaName = Schemas.SelectedValue.ToString();

                if (String.IsNullOrEmpty(schemaName))
                    return;

                _currentSchema = _currentProject.GetSchema(schemaName);

                Tables.ItemsSource = _currentSchema.GetTables();
            }
            catch (Exception ex)
            {
                Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error see output window"; });

                OutputWindowMessage.WriteMessage("Error selecting schema:");
                OutputWindowMessage.WriteMessage(ex.Message);
            }
        }
开发者ID:ternaryalchemy,项目名称:MergeUi,代码行数:24,代码来源:MyControl.xaml.cs


注:本文中的ISchema.GetTables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。