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


C# SqlCeConnection.GetSchema方法代码示例

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


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

示例1: A_connection_can_be_established_with_datastore

        public void A_connection_can_be_established_with_datastore()
        {
            using (SqlCeConnection conn = new SqlCeConnection(_connectionString))
            {
                conn.Open();

                _schemaInfo = conn.GetSchema();
            }

            Assert.That(_schemaInfo.IsInitialized && !_schemaInfo.HasErrors);
        }
开发者ID:AnthonyGilliam,项目名称:HyperQueryNH,代码行数:11,代码来源:SchemaTests.cs

示例2: All_previously_existing_tables_can_be_dropped

        public void All_previously_existing_tables_can_be_dropped()
        {
            NHSession.DropAllTables();

            using (SqlCeConnection conn = new SqlCeConnection(_connectionString))
            {
                conn.Open();

                _schemaInfo = conn.GetSchema("Tables");
            }

            Assert.That(_schemaInfo.Rows.Count == 0);
        }
开发者ID:AnthonyGilliam,项目名称:HyperQueryNH,代码行数:13,代码来源:SchemaTests.cs

示例3: The_data_tables_are_created_upon_schema_export

        public void The_data_tables_are_created_upon_schema_export()
        {
            NHSession.DropAllTables();
            NHSession.ExportModelToDatabase();

            using (SqlCeConnection conn = new SqlCeConnection(_connectionString))
            {
                conn.Open();

                _schemaInfo = conn.GetSchema("Tables");
            }

            Assert.That(_schemaInfo.Rows.Count == 1);
        }
开发者ID:AnthonyGilliam,项目名称:HyperQueryNH,代码行数:14,代码来源:SchemaTests.cs

示例4: Get_Table_Names

        public static DataTable Get_Table_Names()
        {

            SqlCeConnection cn = new SqlCeConnection(_connstring);
            DataTable dt = new DataTable();
            
            try
            {

                cn.Open();
                dt = cn.GetSchema("Tables");
                

            }
            catch (SqlCeException sqlex)
            {
                MessageBox.Show(sqlex.Message, "fail");

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                cn.Close();


            }

            return dt;
            
        }
开发者ID:TeamVader,项目名称:CANBUS_MONITOR,代码行数:33,代码来源:CAN_Monitor_Functions.cs

示例5: GetTables

 public static List<string> GetTables()
 {
     using (SqlCeConnection connection = new SqlCeConnection(_connstring))
     {
         connection.Open();
         DataTable schema = connection.GetSchema("Tables");
         List<string> TableNames = new List<string>();
         foreach (DataRow row in schema.Rows)
         {
             TableNames.Add(row[2].ToString());
         }
         return TableNames;
     }
 }
开发者ID:TeamVader,项目名称:CANBUS_MONITOR,代码行数:14,代码来源:CAN_Monitor_Functions.cs

示例6: GetTableNames

 private static IList<string> GetTableNames(SqlCeConnection testConn)
 {
     var dt = testConn.GetSchema("Tables");
     IList<string> tables = new List<string>();
     foreach (DataRow r in dt.Rows)
     {
         tables.Add(r["TABLE_NAME"].ToString());
     }
     return tables;
 }
开发者ID:raquelsa,项目名称:GalleryServerProWeb,代码行数:10,代码来源:SqlCeMembershipUtils.cs

示例7: SQLCESchema_Click

        private void SQLCESchema_Click(object sender, EventArgs e)
        {
            try
            {
                using (var conn = new SqlCeConnection(txtSqlCeConn.Text))
                {
                    conn.Open();
                    //string[] restriction = new string[] { txtOrclOwner.Text };

                    DataTable schema;
                    if (txtSqlCeSchemaName.Text.Length > 0)
                    {
                        schema = conn.GetSchema(txtSqlCeSchemaName.Text);//, restriction);
                    }
                    else
                        schema = conn.GetSchema();

                    grdGrid.DataSource = schema;
                    grdColumns.DataSource = GetColumns(schema.Columns);
                }
            }
            catch
            {
                throw;
            }
        }
开发者ID:GitOffice,项目名称:SalarDbCodeGenerator,代码行数:26,代码来源:frmTest.cs


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