Search Results

Search found 3 results on 1 pages for 'pnr'.

Page 1/1 | 1 

  • Data tweaking code runs fine when executed directly - but never stops when used in trigger

    - by MBaas
    I have written some code to ensure that items on an order are all numbered (the "position number" or "item number" has been introduced only recently and we did not want to go and change all related code - as it is "asthetics only" and has no functional impact.) So, the idea is to go and check for an records that jave an itemno of NULL or 0 - and then compute one and assign it. When executing this code in a query window, it works fine. When putting it into an AFTER INSERT-trigger, it loops forever. So what is wrong here? /****** Objekt: Trigger [SetzePosNr] Skriptdatum: 02/28/2010 20:06:29 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TRIGGER [SetzePosNr] ON [dbo].[bestellpos] AFTER INSERT AS BEGIN DECLARE @idb int DECLARE @idp int DECLARE @pnr int SELECT @idp=id,@idb=id_bestellungen FROM bestellpos WHERE posnr IS NULL OR posnr=0 WHILE @idp IS NOT NULL BEGIN SELECT @pnr = 1+max(posnr) FROM bestellpos WHERE id_bestellungen = @idb print( 'idp=' + str(@idp) + ', idb=' + str(@idb) + ', posnr=' + str(@pnr)) UPDATE bestellpos SET posnr=@pnr WHERE id=@idp SELECT @idp=id,@idb=id_bestellungen FROM bestellpos WHERE posnr IS NULL OR posnr=0 END END

    Read the article

  • Problem with httpContext.RewritePath on IIS 7

    - by PNR
    I am using httpContext.RewritePath in Global.asax for som URLrewriting, and it works very well in my development environment on the Cassini server. But when I copy it to the production server, witch is a IIS 7 it isn't working. I have also tried to use Context.Server.TransferRequest but thne I get the error: "This operation requires IIS integrated pipeline mode." on both Cassini and IIS 7, and on IIS 7 the website is running in "Integreret" mode in the AppPool. I rewrite all urls on the website like /[The main menuname]/[pagename].aspx fx from /web/thesite.aspx?mainmenu=manager to /manager/thesite.aspx OR /web/theOtherSite.aspx?mainmenu=about to /about/theOtherSite.aspx And so on... Thanks very much in advance!

    Read the article

  • Add additional content to the middle of string from within a method

    - by Sammy T
    I am working with a log file and I have a method which is creating a generic entry in to the log. The generic log entry looks like this: public StringBuilder GetLogMessage(LogEventType logType, object message) { StringBuilder logEntry = new StringBuilder(); logEntry.AppendFormat("DATE={0} ", DateTime.Now.ToString("dd-MMM-yyyy", new CultureInfo(CommonConfig.EnglishCultureCode))); logEntry.AppendFormat("TIME={0} ", DateTime.Now.ToString("HH:mm:ss", new CultureInfo(CommonConfig.EnglishCultureCode))); logEntry.AppendFormat("ERRORNO={0} ", base.RemoteIPAddress.ToString().Replace(".", string.Empty)); logEntry.AppendFormat("IP={0}", base.RemoteIPAddress.ToString()); logEntry.AppendFormat("LANG={0} ", base.Culture.TwoLetterISOLanguageName); logEntry.AppendFormat("PNR={0} ", this.RecordLocator); logEntry.AppendFormat("AGENT={0} ", base.UserAgent); logEntry.AppendFormat("REF={0} ", base.Referrer); logEntry.AppendFormat("SID={0} ", base.CurrentContext.Session.SessionID); logEntry.AppendFormat("LOGTYPE={0} ", logType.ToString() ); logEntry.AppendFormat("MESSAGE={0} ", message); return logEntry; } What would be the best approach for adding additional parameters before "MESSAGE="? For example if I wanted to add "MODULE=" from a derived class when the GetLogMessage is being run. Would a delegate be what I am looking for or marking the method as virtual and overriding it or do I need something entirely different? Any help would be appreciated.

    Read the article

1