What should I use in C# code for Text column?


  • Hi everybody,

    I am working on VFP code conversion into C#. One of the columns in SQL Server is text type. We haven't yet changed image and text columns in our database to the newer varchar(max) /varbinary(max) types although for new tables we do use these types.

    My question is what should I use for SqlDbType in this case? Should I use

    Parameters.Add("@param", SqlDbType.VarChar, -1).Value = text ;?

    E.g. I don't want to keep old deprecated types in C# code. I assume it should work fine, right?

    Thanks in advance.

    For every expert, there is an equal and opposite expert. - Becker's Law

    My blog

    My TechNet articles

    Thursday, May 01, 2014 4:53 PM


All replies