简体   繁体   English

我如何遍历所有System.Data.SqlDbType?

[英]How can i iterate through all System.Data.SqlDbType s?

As my questeion above i would like to iterate through ALL System.Data.SqlDbType s. 作为我上面的问题,我想遍历所有System.Data.SqlDbType How is this possible? 这怎么可能?

I'm thinking about something like this: 我正在考虑这样的事情:

foreach (var type in System.Data.SqlDbType(s))
{
   ..code         
}

I know System.Data.SqlDbType is no List or IEnumerable :) 我知道System.Data.SqlDbType是没有列表或IEnumerable :)

You may try this: 您可以尝试以下方法:

foreach (SqlDbType type in Enum.GetValues(typeof(SqlDbType)))
{
   ..code
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Windows 窗体应用程序中修复“无法从“字符串”转换为 System.Data.SqlDbType” - How to fix 'Cannot convert from 'string' to System.Data.SqlDbType' in a Windows Forms Application 在 System.Data.SqlDbType 和 Microsoft.SqlServer.Management.Smo.SqlDataType 之间转换 - Convert between System.Data.SqlDbType and Microsoft.SqlServer.Management.Smo.SqlDataType 如何遍历表单上的所有复选框? - How can I iterate through all checkboxes on a form? 我可以使用comboBox中的所有项目遍历字典吗? - Can I iterate through a dictionary using all items in a comboBox? 如何遍历未知数量的模型并将该模型中的数据与控制器中的另一个模型进行比较? - How can I iterate through an unknown number of models and compare data in that model to another model in a controller? 如何在文本文件的第n:th行之后遍历数据? - How can I possibly iterate through data after n:th row in a text file? 如何在GroupBox中迭代10个TextBox? - How do I iterate through 10 TextBox's in a GroupBox? 在C#中,如何遍历整个2D数组并计算0的数量? - In C#, How can I iterate through a entire 2D Array and count the number of 0s? .NET系统类型为SqlDbType - .NET System Type to SqlDbType 如何冻结集合以便可以迭代它? - How do I freeze a collection so that I can iterate through it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM