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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
Back
Top