S
Sheila Jones
Hello,
Can somebody tell me what I'm doing wrong here, please? I'm using ADO.Net
from an ASP.Net page to insert records into an Access table. It works OK,
except that the value written to the text field ('Name') is always
right-padded with spaces to the width of the field. Here is the relevant bit
of code:
string sql = @"INSERT INTO PRODUCTS (ID, Name) VALUES (?, ?)";
cmd = new OleDbCommand(sql);
cmd.Connection = con;
cmd.Parameters.Add("@id", OleDbType.Integer);
cmd.Parameters.Add("@name", OleDbType.VarWChar);
cmd.Parameters["@id"].Value = id;
cmd.Parameters["@name"].Value = name;
cmd.ExecuteNonQuery();
Why does it pad, even though the parameter type is VarWChar? Thanks.
Can somebody tell me what I'm doing wrong here, please? I'm using ADO.Net
from an ASP.Net page to insert records into an Access table. It works OK,
except that the value written to the text field ('Name') is always
right-padded with spaces to the width of the field. Here is the relevant bit
of code:
string sql = @"INSERT INTO PRODUCTS (ID, Name) VALUES (?, ?)";
cmd = new OleDbCommand(sql);
cmd.Connection = con;
cmd.Parameters.Add("@id", OleDbType.Integer);
cmd.Parameters.Add("@name", OleDbType.VarWChar);
cmd.Parameters["@id"].Value = id;
cmd.Parameters["@name"].Value = name;
cmd.ExecuteNonQuery();
Why does it pad, even though the parameter type is VarWChar? Thanks.