By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,670 Members | 1,558 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,670 IT Pros & Developers. It's quick & easy.

what is equivalent in c# of a char in sql?

P: n/a
I have a stored procedure using a char(10),
I need to specify that param in c#. What c# data type is
can I use?

I've looked around online for equivalents between sql
types and c# types and couldn't find anything.

I know this is basic, but i can't find the answer.
thanks in advance.
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I never use that one however probably char[10]
Nov 16 '05 #2

P: n/a
-----Original Message-----
I never use that one however probably char[10]
.
you're not understanding my question.

Nov 16 '05 #3

P: n/a
To be used with SqlParameter class? SqlDbType.Char:

SqlCommand cmd = new SqlCommand();
cmd.Parameters.Add("@myParam", SqlDbType.Char);
cmd.Parameters[0].Value = "foo";

HTH,
Alexander

<an*******@discussions.microsoft.com> wrote in message
news:5c****************************@phx.gbl...
I have a stored procedure using a char(10),
I need to specify that param in c#. What c# data type is
can I use?

I've looked around online for equivalents between sql
types and c# types and couldn't find anything.

I know this is basic, but i can't find the answer.
thanks in advance.

Nov 16 '05 #4

P: n/a
ah i see, its a string.

cheers.
Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.