S
SpaceMarine
hello,
i have some simple code that updates my db w/ a user-input string. as
always, i use a Command object w/ Parameters, and pass my text in as
such. like so:
//conn & command
SqlConnection conn = new SqlConnection(myConnStr);
SqlCommand command = new SqlCommand("UpdateFoo", conn);
command.CommandType = CommandType.StoredProcedure;
//params
command.Parameters.Add("@height", SqlDbType.VarChar, 10).Value =
height;
....the height variable is in the format, "6'7". it was my
understanding that since its a parameter, the db would be cool w/ the
single apostrophe. yet, when i review my table's rows, only "6" is
inserted.
any idea what's up?
thanks,
sm
i have some simple code that updates my db w/ a user-input string. as
always, i use a Command object w/ Parameters, and pass my text in as
such. like so:
//conn & command
SqlConnection conn = new SqlConnection(myConnStr);
SqlCommand command = new SqlCommand("UpdateFoo", conn);
command.CommandType = CommandType.StoredProcedure;
//params
command.Parameters.Add("@height", SqlDbType.VarChar, 10).Value =
height;
....the height variable is in the format, "6'7". it was my
understanding that since its a parameter, the db would be cool w/ the
single apostrophe. yet, when i review my table's rows, only "6" is
inserted.
any idea what's up?
thanks,
sm