I try to insert a string into a I set the string to be equal to one value and then add it to a parameter Although every time I try, it ends up looking like this in the database I like this like When I try to string string with this string or I am getting string or binary data will be minimized even if the field > I'm not sure at all, but I think the problem is in AddWithValue. I think the standard parameter char (20) column in my SQL server database I am doing .
thisstring = "1914" cmd.Parameters.AddWithValue (" @ Code ", this string)
1913, 000000, 000001 .
>
thisstring = "" & Amp; The string
While convenient, this method does not allow specifying the exact datatype to pass the database engine nor the size of the parameter. It always passes a nvarchar parameter for the C #Unicode string.
dim p = new SqlParameter ("@ code", SqlDbType.Char, 20) p.Value = thisstring.PadLeft (20 , "")
No comments:
Post a Comment