问题描述
大家好。我需要一些关于泛型的帮助......至少我相信这个。
我的目标是创建一个包含ParamName,ParamValue和ParamType的泛型参数类。这个ParamType需要足够灵活,以接受来自其中一个tyeps(SQL,Oracle和DB2)的任何数据类型。
这甚至可能吗?请帮助:-)。
Hi all. I need some help with generics...at least that's what I believe.
My goal here is to create a generic parameters class that has ParamName, ParamValue, and ParamType. This ParamType needs to be flexible enough to accept any data type from the one of these tyeps (SQL, Oracle, and DB2).
Is this even possible? Please help :-).
Public class GenericParameters
{
public string ParamName;
public string ParamValue;
public ???? ParamDataType;
}
感谢所有回复的人!!!!
Thank you to all who respond!!!!
推荐答案
是 []您可以直接进入将扩展IDbConnection接口的项目。
is a single file[^] you can drop in to your project that will extend your IDbConnection interface.
您可以检查代码处理参数的方式。希望这有帮助。
you can check the code for how they handle parameters as well. hope this helps.
这篇关于如何创建一个通用类型的?DataType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!