SqlParameter class question

  • Thread starter Thread starter jiangyh
  • Start date Start date
J

jiangyh

hi everyone:

SqlParameter class has a property that is DbType looks like following source

public DbType DbType
{
get
{
// TODO: Add DBParameter.DbType getter implementation
return new DbType ();
}
set
{
// TODO: Add DBParameter.DbType setter implementation
}
}

I must define a variant for this property ,my question is which type variant I will use.

thanks a lot
jiangyh
 
Hi,

What are you trying to do?

DbType is an enumeration, it says how to interpret the Value property (which is an object instance ).

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

hi everyone:

SqlParameter class has a property that is DbType looks like following source

public DbType DbType
{
get
{
// TODO: Add DBParameter.DbType getter implementation
return new DbType ();
}
set
{
// TODO: Add DBParameter.DbType setter implementation
}
}

I must define a variant for this property ,my question is which type variant I will use.

thanks a lot
jiangyh
 
hi Ignacio Machin:

I know DbType is an enumeration,but SqlParameter class give this property,what will it return.
I write a class like SqlParameter,must impletement DbType property.which type variant I will return.

thanks you help.
jiangyh
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> дÈëÏûÏ¢ÐÂÎÅ:[email protected]...
Hi,

What are you trying to do?

DbType is an enumeration, it says how to interpret the Value property (which is an object instance ).

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

hi everyone:

SqlParameter class has a property that is DbType looks like following source

public DbType DbType
{
get
{
// TODO: Add DBParameter.DbType getter implementation
return new DbType ();
}
set
{
// TODO: Add DBParameter.DbType setter implementation
}
}

I must define a variant for this property ,my question is which type variant I will use.

thanks a lot
jiangyh
 
Hi,

AFAIK, it's intended as an input property, I mean a property that expect that the user set a value to it.

this would be no problem if it is an reference type, just return null and you are set, as this is an enumerator you have to return a value no matter what,
what value?
It's up to you, IIRC SqlParameter return String


You have to decide what is best for you

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

hi Ignacio Machin:

I know DbType is an enumeration,but SqlParameter class give this property,what will it return.
I write a class like SqlParameter,must impletement DbType property.which type variant I will return.

thanks you help.
jiangyh
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> дÈëÏûÏ¢ÐÂÎÅ:[email protected]...
Hi,

What are you trying to do?

DbType is an enumeration, it says how to interpret the Value property (which is an object instance ).

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

hi everyone:

SqlParameter class has a property that is DbType looks like following source

public DbType DbType
{
get
{
// TODO: Add DBParameter.DbType getter implementation
return new DbType ();
}
set
{
// TODO: Add DBParameter.DbType setter implementation
}
}

I must define a variant for this property ,my question is which type variant I will use.

thanks a lot
jiangyh
 
Back
Top