本文整理汇总了C#中System.Data.SqlClient.SqlDataAdapter.FillInternal方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDataAdapter.FillInternal方法的具体用法?C# SqlDataAdapter.FillInternal怎么用?C# SqlDataAdapter.FillInternal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.SqlDataAdapter
的用法示例。
在下文中一共展示了SqlDataAdapter.FillInternal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteToServer
public void WriteToServer (IDataReader reader)
{
DataTable table = new DataTable ();
SqlDataAdapter adapter = new SqlDataAdapter ();
adapter.FillInternal (table, reader);
BulkCopyToServer (table, 0);
}
示例2: GetColumnMetaData
private DataTable [] GetColumnMetaData ()
{
DataTable [] columnMetaDataTables = new DataTable [2];
SqlCommand cmd = new SqlCommand ("select @@trancount; " +
"set fmtonly on select * from " +
DestinationTableName + " set fmtonly off;" +
"exec sp_tablecollations_90 '" +
DestinationTableName + "'",
connection);
if (externalTransaction != null)
cmd.Transaction = externalTransaction;
SqlDataReader reader = cmd.ExecuteReader ();
int i = 0; // Skipping 1st result
do {
if (i == 1) {
columnMetaDataTables [i - 1] = reader.GetSchemaTable ();
} else if (i == 2) {
SqlDataAdapter adapter = new SqlDataAdapter ();
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
columnMetaDataTables [i - 1] = new DataTable (DestinationTableName);
adapter.FillInternal (columnMetaDataTables [i - 1], reader);
}
i++;
} while (reader.IsClosed == false && reader.NextResult());
reader.Close ();
return columnMetaDataTables;
}