|
-
Jul 3rd, 2007, 11:19 PM
#1
Thread Starter
Addicted Member
define and cast to a generic object...
Hello all,
Ok, basically, I have a generic DataParameter class, defined as below...
Code:
class DataParameter<T> {
private string _name;
private T _value;
private SqlDbType _dataType;
public string Name {
//stuff
}
public T Value {
//stuff
}
public SqlDbType DataType {
//stuff
}
public DataParameter(string ParameterName, T ParameterValue, SqlDbType ParameterDataType) {
//stuff;
}
so basically, how I have structured my data class, is that you define a parameter of what datatype u need.. 'DataParameter<string>' for instance. You add the name, value, and datatype using the constructer. Then you add the parameter object to a hashtable.
My problem is getting it back out of the hashtable. I am unsure as to how i define the class, as to what datatype to put in the <>...
Is there possibly another collection that i should use, that will hold the type of the generic class?
Cheers,
Justin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|