public static void ExecuteSqlString(object sqlStmt) { string sSqlStmt = (string)sqlStmt; using (var entity = new db_SeguimientoProtocolo_r2Entities()) { entity.ExecuteStoreCommand(sSqlStmt); } }
public void log(string msg, string where) { try { using (var entity = new db_SeguimientoProtocolo_r2Entities()) { string sqlExists = " if object_id('templog','u') is null begin create table templog (id int identity(1,1) , msg nvarchar(max), t datetime) end"; entity.ExecuteStoreCommand(sqlExists); string sqlInsert = "insert into templog(msg,t) select '" + where + " _ [" + msg + "]',getdate()"; entity.ExecuteStoreCommand(sqlInsert); } } catch (Exception) { ; } }
public long PrepareBulkUpsertUploaded() { long session = 0; using (var entity = new db_SeguimientoProtocolo_r2Entities()) { session = (new UNID()).getNewUNID(); string sqlCmd = "select TOP 1 * into " + this.GetTmpUploadedTable(session) + " from CI_REGISTRO; TRUNCATE TABLE " + this.GetTmpUploadedTable(session); entity.ExecuteStoreCommand(sqlCmd); } return session; }