本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
}