BaseServerName 使用的 Microsoft SQL ServerSqlDataReader实例的名称。 BaseTableName 包含该列的数据存储区中的表或视图的名称。 如果无法确定基表名称,则为 NULL 值。 此列的默认值为 null 值。 ColumnName 列的名称;这可能不是唯一的。 如果这无法确定,则返回 NULL 值。 此名称始终反映当前视图或命令文本中...
data.Column2 = reader.GetValue(reader.GetOrdinal("COLUMN2")).ToString(); data.Column3 = reader.GetDateTime(reader.GetOrdinal("COLUMN3")); } Solution 1: The column ordinal can be obtained by using reader.GetOrdinal(string), where the name of the column is passed as a parameter. The Sq...
internal int FillFromReader(DataSet dataset, DataTable datatable, string srcTable, DataReaderContainer dataReader, int startRecord, int maxRecords, DataColumn parentChapterColumn, object parentChapterValue) { int num2 = 0; int schemaCount = 0; do { if (0 < dataReader.FieldCount) { SchemaMapping...
Namespace: System.Data.SqlClient Assembly: System.Data.SqlClient.dll Package: System.Data.SqlClient v4.9.0 Source: System.Data.SqlClient.notsupported.cs Synchronously gets the value of the specified column as a type.GetFieldValueAsync<T>(Int32, CancellationToken)is the asynchronous version of th...
GetName(Int32) Získá název zadaného sloupce. GetOrdinal(String) Získá pořadové číslo sloupce vzhledem k názvu sloupce. GetProviderSpecificFieldType(Int32) Získá, Object který je reprezentace podkladového typu pole specifického zprostředkovatele. GetProviderSpecificValue(Int...
{49String colName =dataRow.Table.Columns[i].ColumnName;50PropertyInfo pInfo =typeof(T).GetProperty(colName);51if(pInfo ==null|| !pInfo.CanWrite)continue;52MethodInfo mInfo =typeof(DataRowExtensions).GetMethod("Field",newType[] {typeof(DataRow),typeof(String) }).MakeGenericMethod(p...
Namespace: System.Data.SqlClient Assembly: System.Data.SqlClient.dll Package: System.Data.SqlClient v4.9.0 Source: System.Data.SqlClient.notsupported.cs Asynchronously gets the value of the specified column as a type. GetFieldValue<T>(Int32) is the synchronous version of this method. ...
BaseServerNameThe name of the instance of Microsoft SQL Server used by theSqlDataReader. BaseTableNameThe name of the table or view in the data store that contains the column. A null value if the base table name cannot be determined. The default of this column is a null value. ...
Gets the value of the specified column as a 32-bit signed integer. GetInt64(Int32) Gets the value of the specified column as a 64-bit signed integer. GetName(Int32) Gets the name of the specified column. GetOrdinal(String) Gets the column ordinal, given the name of the column. ...
// get the results of each column string contact = (string)rdr["ContactName"]; string company = (string)rdr["CompanyName"]; string city = (string)rdr["City"]; // print out the results Console.Write("{0,-25}", contact);