M
MJB
I’m doing bulk updates to my database via a dataset by using the
SqlDataAdapter.Update method. The problem is there seems to mysterious
string padding showing up in the database entry. For example here are the
parameters I am using.
adapter.InsertCommand.Parameters.Add("@MachineName", SqlDbType.NVarChar,
256, "MachineName");
adapter.UpdateCommand.Parameters.Add("@MachineName", SqlDbType.NVarChar,
256, "MachineName");
If I create a row in my dataset like so:
MachineName = “MYMACHINEâ€
it shows up in the database as
“MYMACHINE___________________“ (exactly 256 characters in length).
I have checked the incoming data and it does not have this padding. Does
anyone have an explanation on this or a solution?
Thanks in advance,
MJB
SqlDataAdapter.Update method. The problem is there seems to mysterious
string padding showing up in the database entry. For example here are the
parameters I am using.
adapter.InsertCommand.Parameters.Add("@MachineName", SqlDbType.NVarChar,
256, "MachineName");
adapter.UpdateCommand.Parameters.Add("@MachineName", SqlDbType.NVarChar,
256, "MachineName");
If I create a row in my dataset like so:
MachineName = “MYMACHINEâ€
it shows up in the database as
“MYMACHINE___________________“ (exactly 256 characters in length).
I have checked the incoming data and it does not have this padding. Does
anyone have an explanation on this or a solution?
Thanks in advance,
MJB