G
Guest
this is the call
private void Page_Load(object sender, System.EventArgs e)
{
OdbcConnection connection = new OdbcConnection ("DSN=xyz");
CreateDataAdapter(connection);
}
this is the code, no errors, but NO UPDATE I have to use ODBC I just need to
update a field based on a key, EMBARASSED to say days going around syntax
PLEASE SOMEONE
public static OdbcDataAdapter CreateDataAdapter(OdbcConnection connection)
{
string selectCommand ="SELECT rtrim(CommodityKey), CommodityShortDescr
FROM INCOMMOD";
OdbcDataAdapter adapter = new OdbcDataAdapter(selectCommand, connection);
adapter.UpdateCommand = new OdbcCommand( "UPDATE INCOMMOD SET
CommodityShortDescr = ? WHERE rtrim(CommodityKey) = ?");
adapter.UpdateCommand.Parameters.Add("@CommodityKey",
OdbcType.Char, 8, "CommodityKey");
adapter.UpdateCommand.Parameters.Add("@CommodityShortDescr",
OdbcType.Char, 1, "CommodityShortDescr");
adapter.UpdateCommand.Parameters["@CommodityShortDescr"].Value = "X";
return adapter;
}
no errors, no update occurs, the statement runs on server engine using
pervasive SQL and control center the update statement works.
private void Page_Load(object sender, System.EventArgs e)
{
OdbcConnection connection = new OdbcConnection ("DSN=xyz");
CreateDataAdapter(connection);
}
this is the code, no errors, but NO UPDATE I have to use ODBC I just need to
update a field based on a key, EMBARASSED to say days going around syntax
PLEASE SOMEONE
public static OdbcDataAdapter CreateDataAdapter(OdbcConnection connection)
{
string selectCommand ="SELECT rtrim(CommodityKey), CommodityShortDescr
FROM INCOMMOD";
OdbcDataAdapter adapter = new OdbcDataAdapter(selectCommand, connection);
adapter.UpdateCommand = new OdbcCommand( "UPDATE INCOMMOD SET
CommodityShortDescr = ? WHERE rtrim(CommodityKey) = ?");
adapter.UpdateCommand.Parameters.Add("@CommodityKey",
OdbcType.Char, 8, "CommodityKey");
adapter.UpdateCommand.Parameters.Add("@CommodityShortDescr",
OdbcType.Char, 1, "CommodityShortDescr");
adapter.UpdateCommand.Parameters["@CommodityShortDescr"].Value = "X";
return adapter;
}
no errors, no update occurs, the statement runs on server engine using
pervasive SQL and control center the update statement works.