View Single Post
  #2 (permalink)  
Old April 7th, 2006, 08:55 PM
thenextbillgates thenextbillgates is offline
Registered User
 
Join Date: Apr 2006
Location: Pensacola, Fl, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the exact code now. It's a function that swaps two locations.

Code:
int HighLocation, LowLocation;
ModuleDataView.Table = UserInfoDSInstance.USERMODULE;            
ModuleDataView.Sort = "UMPOSITION";
ModuleDataView.RowFilter = "MID=" + CallingModule;
HighLocation = (int)ModuleDataView[0]["UMPOSITION"];
ModuleDataView.Table = UserInfoDSInstance.USERMODULE;            
ModuleDataView.Sort = "UMPOSITION";
ModuleDataView.RowFilter = "UMPOSITION>=" + HighLocation;
LowLocation = (int)ModuleDataView[1]["UMPOSITION"];
ModuleDataView[0]["UMPOSITION"] = LowLocation;
ModuleDataView[1]["UMPOSITION"] = HighLocation;
oracleUpdateCommand1.CommandText = "UPDATE USERMODULE SET UMPOSITION = " + LowLocation + " WHERE MID = " + (int)ModuleDataView[0]["MID"] + " AND USERID = '" + UserID + "'";
OracleConnection.Open();
oracleUpdateCommand1.ExecuteScalar();
oracleUpdateCommand1.CommandText = "UPDATE USERMODULE SET UMPOSITION = " + HighLocation + " WHERE MID = " + (int)ModuleDataView[1]["MID"] + " AND USERID = '" + UserID + "'";
oracleUpdateCommand1.ExecuteScalar();
OracleConnection.Close();
The changes are not being written to the database. Not sure why...