Public string Getvideoidbyvideoname (string videoname)
{
string item = "";
try
{
DBManager DBManager = this. Getdbmanager (Conutil.caseid);
if (DBManager = = null)
{
&NB Sp logger. Warnformat ("Unknown database library: {0}", Conutil.caseid);
return null;
}
dbparameter[] array = dbmanager.createdbparameters (1);
array[0]. ParameterName = "Videoname";
array[0]. DbType = dbtype.string;
array[0]. Value = Videoname;
DataSet DataSet = Dbmanager.executedataset (THIS.SQLPROVIDER.GETVIDEOIDBYVIDEONAMESQL, CommandType.Text, array);
if (Dataset.tables[0]. Rows.Count > 0)
{
DataRow datarow = Dataset.tables[0]. Rows[0];
Item = datarow["ID"]. ToString ();
}
Else
{
Logger. Error ("No corresponding video ID found");
return null;
}
}
catch (Exception Exception)
{
Logger. Warn ("Submit Task Exception", exception);
return null;
}
return item;
}
public string Getvideoidbyvideonamesql
{
Get
{
Return "Select ID from Videoresource WHERE [email protected]";
}
}
Rectangular region serialization, cropcoordinatexml to be uploaded to the database table
System.Drawing.Rectangle rect = new System.Drawing.Rectangle ()
{
X = Xstart,
Y = Ystart,
width = width,
Height = height
};
String cropcoordinatexml = Spgz. Conutilities.misc.xmlhelper.toxmlstring<system.drawing.rectangle> (rect);
public string Addvideoabclqueryresultsql
{
Get
{
Return "INSERT into Chart1 (taskid,similarity,objimgfilename,cropcoordinatexml) VALUES (@taskID, @similarity, @ Objimgfilename, @cropCoordinateXML); ";
}
}
Database operations: Finding tables, updating