When I edit one table I would like to be able to do an update on another one
I have an “asset” table
Devicename; IP; Field 1; Field 2;
An “IP” table
IP; Devicename
the two tables are related and when I add a devicename in asset I have a drop down menu that shows me only free ip's
in the after add session I update the IP table by occupying the selected ip with the new devicename entered
String NAME = values[“DEVICENAME”];
String IND = values[“IP”];
string strSQLupdate = “update [dbo].[IP] set DEVICENAME =‘”+NAME+“’ where [dbo].[ip].IP = ‘”+IND+"’”
CommonFunctions.db_exec(strSQLupdate, null);
When I edit the asset table.
In process record Value I put null to the devicename value in IP table this allows me to free the ip and be able to reselect it
String strSQLupdate = “update [dbo].[IP] set DEVICENAME = NULL where [dbo].[ip].IP = ‘”+IND+"’”
CommonFunctions.db_exec(strSQLupdate, null);
In after edit I update the devicename field of the IP table again
String NAME = values[“DEVICENAME”];
String IND = values[“IP”];
String strSQLupdate = “update [dbo].[IP] set DEVICENAME =‘”+NAME+“’ where [dbo].[ip].IP = ‘”+IND+"’”
But it doesn't work because in Ip table the value of the device results NUll
Where do I go wrong