I'm more than a little bit confused by the last parameter of one of the
overloads of this constructor. I'm pretty certain that I need to specify
that the parameter is an output and what the source column is, and so I'm
constrained to this overload. I just don't know what the last parameter is
for.
I'm creating the update SQL, shown below. I've included a reference to an
object in the tenth parameter, as required by the constructors parameter
list, but it seems to be redundant in light of the ninth parameter, which is
said to be the name of the source column. If anyone could shed some light
on this for me I would be very grateful.
Also, is there another way to go about this that would not involve using
this particular overload of the OdbcParameter constructor?
cmd.CommandText = "@UPDATE \"tblSubCategory\" SET \"SubCategory\" = ? "
+ "WHERE \"Category\" = ?; "
+ "UPDATE \"tblCategory\" SET \"Category\" =
? "
+ "WHERE \"Category\" = ?";
cmd.Parameters.Add(new System.Data.Odbc.OdbcParameter("SubCategory",
System.Data.Odbc.OdbcType.NVarChar, 50, "SubCategory"));
cmd.Parameters.Add(new System.Data.Odbc.OdbcParameter("Category",
System.Data.Odbc.OdbcType.NVarChar, 50, "Category"));
cmd.Parameters.Add(new System.Data.Odbc.OdbcParameter("NewCategory",
System.Data.Odbc.OdbcType.NVarChar, 50, "Category"));
cmd.Parameters.Add(new System.Data.Odbc.OdbcParameter("OldCategory",
System.Data.Odbc.OdbcType.NVarChar, 50, ParameterDirection.Output, false, 0,
0, "Category", DataRowVersion.Current,
dsCatSubCats.Tables["Categories"].Columns["Category"] ));