J
Jim Heavey
I am having some difficulty figuring out how to pass the "right" dataType
to create a Data Parameter.
Suppose that I have created a data Parameter and set it's datatype, now I
want to use that same dataType to create another parmameter somewhere else
in the program. My problem is that if I us the "DataColumn.DataType" which
returns the "type" of the column, I am unable to figure out how to use this
type to create my "new" parameter.
So here is the signature of the method that I am calling to create my new
Parameter...
public IDbDataParameter CreateDataParameter
(string parameterName, Type dataType, string sourceColumn,
DataRowVersion version)
When I pass the following to this method
(Type) dc.DataType
I get an error message indicating that "Can not convert 'Type" to
System.Data.DbType"
If I just attempt to pass dc.DbType i get the error of "Can not convert
System.Type to System.Data.DbType"
DbType typ = (System.Data.DbType) dc.DataType;
What do I need to do to pass the correct type to this method?
to create a Data Parameter.
Suppose that I have created a data Parameter and set it's datatype, now I
want to use that same dataType to create another parmameter somewhere else
in the program. My problem is that if I us the "DataColumn.DataType" which
returns the "type" of the column, I am unable to figure out how to use this
type to create my "new" parameter.
So here is the signature of the method that I am calling to create my new
Parameter...
public IDbDataParameter CreateDataParameter
(string parameterName, Type dataType, string sourceColumn,
DataRowVersion version)
When I pass the following to this method
(Type) dc.DataType
I get an error message indicating that "Can not convert 'Type" to
System.Data.DbType"
If I just attempt to pass dc.DbType i get the error of "Can not convert
System.Type to System.Data.DbType"
DbType typ = (System.Data.DbType) dc.DataType;
What do I need to do to pass the correct type to this method?