本文整理汇总了C#中Dicom.Data.DcmDataset.GetValueString方法的典型用法代码示例。如果您正苦于以下问题:C# DcmDataset.GetValueString方法的具体用法?C# DcmDataset.GetValueString怎么用?C# DcmDataset.GetValueString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dicom.Data.DcmDataset
的用法示例。
在下文中一共展示了DcmDataset.GetValueString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Match
public bool Match(DcmDataset dataset)
{
if (dataset.Contains(_tag)) {
string value = dataset.GetValueString(_tag);
return value.Contains(_value);
}
return false;
}
示例2: Transform
public void Transform(DcmDataset dataset) {
IDbConnection connection = null;
try {
if (_dbType == DatabaseType.Odbc)
connection = new OdbcConnection(_connectionString);
else if (_dbType == DatabaseType.MsSql)
connection = new SqlConnection(_connectionString);
using (IDbCommand command = connection.CreateCommand()) {
command.Connection = connection;
command.CommandText = _query;
for (int i = 0; i < _params.Count; i++) {
string str = dataset.GetValueString(_params[i]);
SqlParameter prm = new SqlParameter(String.Format("@{0}", i), str);
command.Parameters.Add(prm);
}
connection.Open();
if (_output.Count == 0) {
command.ExecuteNonQuery();
} else {
using (IDataReader reader = command.ExecuteReader()) {
if (reader.Read()) {
for (int i = 0; i < _output.Count; i++) {
string str = reader.GetString(i);
dataset.AddElementWithValueString(_output[i], str);
}
}
}
}
connection.Close();
connection = null;
}
} finally {
if (connection != null) {
if (connection.State == ConnectionState.Closed || connection.State == ConnectionState.Broken)
connection.Close();
connection.Dispose();
}
}
}