c# - Version mismatch issue when using LastWriteTime.Ticks -
i had code
dataset.dataversion.adddataversionrow((new fileinfo(path + permissionfile)).lastwritetime.ticks);
but when changed getting other functionality not working,i dont know why not working.this modified ,not working code
long version = (new fileinfo(path + permissionfile)).lastwritetime.ticks; if (dataset.dataversion.count == 0) { dataset.dataversion.adddataversionrow(version); } else if (version > dataset.dataversion[0].version) { dataset.dataversion[0].version = version; }
do need add 1 more else loop here
hard answer without more information, maybe want update last entry in dataversion:
int count = dataset.dataversion.count; if (count == 0) { dataset.dataversion.adddataversionrow(version); } else if (version > dataset.dataversion[count-1].version) { dataset.dataversion[count-1].version = version; }
Comments
Post a Comment