473,322 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

SqlParameter class question

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
Nov 16 '05 #1
3 2430
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

"jiangyh" <ca****@msn.com> wrote in message news:uw**************@TK2MSFTNGP12.phx.gbl...
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
Nov 16 '05 #2
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> дÈëÏûÏ¢ÐÂÎÅ:eF**************@TK2MSFTNGP14.phx.gbl ...
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

"jiangyh" <ca****@msn.com> wrote in message news:uw**************@TK2MSFTNGP12.phx.gbl...
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
Nov 16 '05 #3
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

"jiangyh" <ca****@msn.com> wrote in message news:ea**************@TK2MSFTNGP09.phx.gbl...
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> дÈëÏûÏ¢ÐÂÎÅ:eF**************@TK2MSFTNGP14.phx.gbl ...
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

"jiangyh" <ca****@msn.com> wrote in message news:uw**************@TK2MSFTNGP12.phx.gbl...
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
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marcin | last post by:
hi, I would like to ask how to serialize class with members like SqlParameter. I try to use BinaryFormatter. public class Example_Class { public SqlParameter sqlParam; public...
5
by: Daniel Groh | last post by:
What is the best way to access a procedure ? MyCommand.Parameters.Add("@param1",typeof(string)); or SqlParameter myParam = new SqlParameter(); myParam.Add("@param1",typeof(string)); What...
4
by: Jason Huang | last post by:
Hi, I want to use the Sqlparameter and SqlDataAdapter to update my data, and the data will be updated based on two TextBoxes txtCustName and txtCustAddress. Thanks for help. Jason
5
by: Jason Huang | last post by:
Hi, The SqlParameter myPM =new SqlParameter("@Address", txtAddress.Text) is working for update, but SqlParameter myPM =new SqlParameter ("@Address",SqlDbType.NVarChar,90,txtAddress.Text) is...
2
by: Stephan | last post by:
Hi, I'm experiencing the problem mentioned in the title above. Briefly, I build a page in which I include a class. This class contains a procedure to add a value to an ArrayList. The value is...
3
by: Stacey Levine | last post by:
I have a webservice that has the below procedure. Basically a procedure to called a stored procedure and return the results. When I try to call the webservice from my program I get the error. Both...
1
by: BobRoyAce | last post by:
I have a class that has several Subs that do DB things, some of which require the same set of parameters to be passed to a stored procedure. One class has 12 parameters and part of code used to...
6
by: Tim Zych | last post by:
' Declare a new parameter object Dim param() As SqlParameter = New SqlParameter(0) {} ' Set this to null and make it an InputOutput parameter param(0) = New SqlParameter("@Something, DBNull.Value)...
2
by: tshad | last post by:
I am trying to build my own DB Class and am trying to set up my parameter list in an array of SqlParameter objects. In my regular code I would do something like:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.