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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top