Case when network is change

Hi,
I am creating a UDP/TCP client connection and sending/receiving data. When the network is changed (from LAN to wireless or vice versa) at my machine do I need to use any Windows API to send/receive data using active network? Do I need to do this in Windows
or Windows API handles it itself?
When the connection is changed, i initialize the socket, create it again & establish a new connection. But it still use old network.
Any Suggestion?

I got the answer
http://www.codeproject.com/Articles/5960/More-on-using-IP-Helper-API-s
Thanks

Similar Messages

  • How can I fire an event case on the value change of an indicator, or a network variable?

    Hi!  I have an event structure setup to look for a value change of an indicator on the front panel.  The indicator is updated by the value of a boolean network-published shared variable through a seperate parallel loop that is polling all of the network-published shared variables.  The event, however, does not fire when the indicator changes value.  I have switched the indicator to a control and tested it with user interaction and that works just fine.
    I want to use the event structure space for my code exectution because it seems logical that that is where it would go, and it will help keep my block diagram tity.  The code is also something I would like executed with the front pannel temperarily disabled.  I would rather not have the code in my network-variable polling loop because again the tity issue.   I would also rather not use a notification VI wired to an independent loop for this particular code.
    Is there a way to have an event structure fire an event with the value change of an indicator, or a network variable directly?
    Thanks for your input.
    LV 8.5
    -Nic

    Thanks for the reply.
    I went about things a little differently, but got them to work so..... .  It really was not my desire to have a boolean indicator on the front panel.  As previously stated, my ultimate goal was to have an event fire on the change of a network variable, which I had to poll for anyway but that is tucked away in a section where I am handling all my network variables.  I ended up using that Create User Event, Register User Event, and Generate User Event SubVIs to handle the task.
    I've read the help for all of those SubVI's and it is not entirely clear to me if the event fires every time the "Generate User Event" receives some inputs, or if it only fires when the value changes.  I could do a test to find out.  It wouldn't be too difficult to add a shift register or a feedback node and place the Generate User Event in a case structure so that it is only fired when the input changes state.

  • Help in changing plsql case when to decode

    Hi,
    Can anyone help me to change this sql for it to use decode function instead of case when? Below is the sql code
    Thanks in advance.
    SELECT
    parts,
    weeks,
    SUM(qty) qty
    FROM (
    SELECT
    CASE
    WHEN ((is_tbd = 'yes' AND is_tbd_order = 'no') OR ex_fac_date > v_asofdate + 131) THEN 'tbd'
    WHEN ex_fac_date BETWEEN v_asofdate - 1 AND v_asofdate + 5 AND is_tbd = 'no' THEN 'wk1'
    WHEN ex_fac_date BETWEEN v_asofdate + 6 AND v_asofdate + 12 AND is_tbd = 'no' THEN 'wk2'
    WHEN ex_fac_date BETWEEN v_asofdate + 13 AND v_asofdate + 19 AND is_tbd = 'no' THEN 'wk3'
    WHEN ex_fac_date BETWEEN v_asofdate + 20 AND v_asofdate + 26 AND is_tbd = 'no' THEN 'wk4'
    WHEN (ex_fac_date < v_asofdate - 1) AND is_tbd = 'no' THEN 'past_due'
    END weeks,
    ffdate,
    parts,
    SUM(qty) qty
    FROM
    delivery)

    I can't use case because my oracle is 8i,Please join 21st Century
    Can you help me checnge this to if then elsif insteadSQL does does contain IF statement!

  • Event when network changes

    Hello all,
    I am trying to figure how to use an activex callback when the computers(windows 7) network connection changes.
    I am able to access and use properties of the NETWORKLIST.INetworkListManager class but I am not able to get the Reg Event Callback to work for NETWORKLIST.INetworkListManager.NetworkConnectivityChanged.
    Does anyone have experience with this class or more ActiveX knowledge to get this working?
    Perhaps there is another more commonly used method to see network changes without polling?
    I hope I have provided enough details to get some help. Thank you for your time.
    Attachments:
    Z_NetworkConnectivityChangedEvent.vi ‏15 KB
    Z_NetworkCPropteryChangedEventCallback.vi ‏8 KB

    Wandern wrote:
    Hello all,
    I am trying to figure how to use an activex callback when the computers(windows 7) network connection changes.
    I am able to access and use properties of the NETWORKLIST.INetworkListManager class but I am not able to get the Reg Event Callback to work for NETWORKLIST.INetworkListManager.NetworkConnectivityChanged.
    Does anyone have experience with this class or more ActiveX knowledge to get this working?
    Perhaps there is another more commonly used method to see network changes without polling?
    I hope I have provided enough details to get some help. Thank you for your time.
    I cannot get this working in LabVIEW 2013 32-bit.
    Not sure why.
    I am able to get the callback to work in C# Express 2010.

  • Using CASE WHEN to change background color

    I've done this many times without any problems, but this time its a little different situation and I can't get it to work.
    I can use this CASE WHEN statement without any problems.
    CASE WHEN
    NAME in
    (select EMP_REQUEST_NAME from OAX_PTA_LOGGER where
    EMP_REQUEST_NAME = NAME and
    EMP_ASSIST_NAME is null and
    JOB_NO = :P24_JOB_NO)
    THEN
    '<span style="color:brown;background-color:yellow">'||NAME||'</font>'
    ELSE "NAME"
    END
    "NAME",
    But I Cant Get This One to Work
    CASE WHEN
    NAME in
    (select EMP_REQUEST_NAME from OAX_PTA_LOGGER where
    EMP_REQUEST_NAME = NAME and
    EMP_ASSIST_NAME is null and
    JOB_NO = :P24_JOB_NO)
    THEN
    '<span style="color:brown;background-color:yellow">'||NAME_DISPLAY||'</font>'
    ELSE "NAME"
    END
    "NAME" NAME_DISPLAY,
    I'm sure that the problem lies with <"NAME" NAME_DISPLAY> but I can't find my way to a solution.
    Does anyone have any ideas for me?

    I've done this many times without any problems, but this time its a little different situation and I can't get it to work.
    I can use this CASE WHEN statement without any problems.
    CASE WHEN
    NAME in
    (select EMP_REQUEST_NAME from OAX_PTA_LOGGER where EMP_REQUEST_NAME = NAME and
    EMP_ASSIST_NAME is null and
    JOB_NO = :P24_JOB_NO)
    THEN
    (ignore this) span style="color:brown;background-color:yellow">'||NAME||' (ignore this)
    ELSE "NAME"
    END
    "NAME",
    But I Cant Get This One to Work
    CASE WHEN
    NAME in
    (select EMP_REQUEST_NAME from OAX_PTA_LOGGER where EMP_REQUEST_NAME = NAME and
    EMP_ASSIST_NAME is null and
    JOB_NO = :P24_JOB_NO)
    THEN
    (ignore this) span style="color:brown;background-color:yellow">'||NAME||' (ignore this)
    ELSE "NAME"
    END
    "NAME" NAME_DISPLAY,
    I'm sure that the problem lies with <"NAME" NAME_DISPLAY> but I can't find my way to a solution. Does anyone have any ideas for me?

  • How to conect when network password has been changed

    how to conect when network password has been changed

    Select the network under Settings > General > WiFi and tap Forget This Network. Select the network again and enter the new password when prompted.

  • Case when statement not working

    hi there, I am trying to work out how to get my case statement to work.
    I have got the following code. 
    select pthproto.pthdbo.cnarole.tpkcnarole, pthproto.pthdbo.cnaidta.formataddr as formataddr, cnaidta.dateeffect as maxdate, isnull(cast (pthproto.pthdbo.cnaaddr.prefix1key as varchar (50)),'') + ' ' + isnull(cast (pthproto.pthdbo.cnaaddr.prefix2key
    as varchar (50)),'')+ ' ' + isnull(cast (pthproto.pthdbo.cnaaddr.prefix3key as varchar (50)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.houseidkey as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component1
    as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component2 as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component3 as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component4
    as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component5 as varchar (100)),'') as mailaddress, row_number() over(partition by pthproto.pthdbo.cnarole.tpkcnarole order by cnaidta.dateeffect desc) as rn into #address from pthproto.pthdbo.cnarole
    inner join pthproto.pthdbo.cnaidty on cnarole.tfkcnaidty =cnaidty.tpkcnaidty inner join pthproto.pthdbo.cnaidta on cnaidty.tpkcnaidty = cnaidta.tfkcnaidty inner join pthproto.pthdbo.cnaaddr on cnaidta.tfkcnaaddr = cnaaddr.tpkcnaaddr order by cnaidta.dateeffect
    select *, case when mailaddress is not null then mailaddress else formataddr end as test from #address where tpkcnarole = '18306695'
    The case when statement is struggling with how i have created the column mailaddress.  As it does seem to understand when it is null.  In the example I have got there is no value in any of the columns to create
    the mailaddress.  Hence why I am referencing it from elsewhere.  Due to having a way on the system where it picks up data from 2 different places.    The mailaddress is always correct if there is one, hence why
    trying to reference that one first.  So how do i change this case when statement to work ?            

    It's ok I have fixed my own problem
    when
    (mailaddress
    is
    null 
    or mailaddress

    then formataddr
    else mailaddress
    end
    as test
    case

  • How can I execute a vi when a switch changes

    I have a switch which controls the input to a VI (it is slightly more complicated than that, but that's the basic idea).
    The VI is a "set" function.  So it really should only execute when the value changes. 
    Is there some way to set the switch so that there is only data available on the output when the switch is switched, thus executing the VI once?
    If not, what is the best way to do this?
    Thank you.
    B.

    BPerlman wrote:
    Thank you.
    An event structure sounds like just what I need.  I am not going to get into the design patterns you mentioned here .... this is a demo program and there is a switch on the front panel that demos a feature in our library, turning it on and off.  I just want to call a library function to turn the feature on or off at user request....the rest of the demo works (right now, I call the VI to turn on/off the feature every time through my main loop -- this is ugly and causes us timing problems... but everything else is finished)
    I tried to add an event structure but don't seem to have it in my edition of LabVIEW....
    What I just added now is a shift register to save the value of the switch between loop iterations, and I compare it to the current value, then feed it into a true/false case structure, only calling my "set" VI when the two values are different...
    Is there a better way, or is that all I can do unless my company buys a fancier LabVIEW version?
    Thanks.
    B.
    Shameless plug for an idea in the idea exchange. Since this would have helped you resolve your issue you might want to consider giving a kudo to this idea.
    The way you are doing it now with the shift register is pretty much the only way you can do this without using an event structure.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Problem with case when statement, when doing an insert.

    Hi there,  I have written the following coding, that has got an issue, due to not being allowed null values to be inserted into a column on a table.
    ,Case 
    WHENCL.LocationISNOTNULLANDCL.[Floor]ISNOTNULLANDCL.RoomISNULLTHEN
    (SELECTTop1
    FL.FloorIDFROMPMIS.dbo.ConsentLocationF
    JOINtbBuildingBONB.BuildingNumber=F.LocationCOLLATELatin1_General_CI_AS
    JOINtbFloorFLONFL.BuildingID=B.BuildingID
    WHEREF.Location=CL.LocationANDFL.FloorName=CL.[Floor]COLLATELatin1_General_CI_AS)
    WHENCL.LocationISNOTNULLANDCL.[Floor]ISNOTNULLANDCL.RoomISNOTNULLTHEN
    (SELECTTop1
    R.RoomIDFROMPMIS.dbo.ConsentLocationF
    JOINtbBuildingBONB.BuildingNumber=F.LocationCOLLATELatin1_General_CI_AS
    JOINtbFloorFLONFL.BuildingID=B.BuildingID
    JOINtbRoomRONR.FloorID=FL.FloorID
    WHEREF.Location=CL.LocationANDFL.FloorName=CL.[Floor]COLLATELatin1_General_CI_ASANDR.RoomNumber=CL.RoomCOLLATELatin1_General_CI_AS)
    ENDasParentID
    I have written this case when statement above to find a ParentID.  I have got the case when statement to work individually, e.g. I get the correct records back.  However when I put it into a insert statement, as I want this ParentID to go
    into a column in a table I get an error with the following message. 
    Cannot insert the value NULL into column 'ParentID', table 'K2_Master_4_Test.dbo.tbConsentLink'; column does not allow nulls. INSERT fails.
    Can someone point me in the right direction, as to what I need to do to get this case when statement working?  Also no I cannot change the structure of the table to allow for null values either.  So I need to modifiy this one.

    The error is valid because your table column has 'not null' constraint and when your case expression does not satisfy  either of the 'when' conditions, it is returning NULL to the insert statement.
    you can get around this by defining a generic value. Simple Example
    select case when <<Column>>=1 then 'First' When <<Column>>=2 then 'Second' Else 'Last' End
    In this case, when column value is not 1 or 2, it will insert 'Last'.
    So, you have to do something like this...i.e add ELSE condition to your case..
    Hope it Helps!!

  • Update multiple rows using CASE WHEN

    I have the table ACCOUNT of structure as follow: 
    ACCOUNT_ID
    ACCOUNT_STATUS
    004460721
    2
    042056291
    5
    601272065
    3
    I need to update the three rows at once using one SELECT statement such that, the second column will be 5, 3, 2 respectively.
    I used the following query but seems there is something missing
    UPDATE ACCOUNT
    SET ACCOUNT_STATUS = CASE  
    WHEN ACCOUNT_STATUS = '004460721' THEN 5 
    WHEN ACCOUNT_STATUS = '042056291' THEN 3 
    WHEN ACCOUNT_STATUS = '601272065' THEN 2 
    WHERE ACCOUNT_ID IN ('004460721','042056291','601272065') 
    My question, is this way correct? if no, can I use CASE WHEN statement and how or I only have choice of using SUB-SELECT to acheive that in one statement?

    Hi,
    Hawk333 wrote:
    I have the table ACCOUNT of structure as follow:
    ACCOUNT_ID
    ACCOUNT_STATUS
    004460721
    2
    042056291
    5
    601272065
    3
    I need to update the three rows at once using one SELECT statement such that, the second column will be 5, 3, 2 respectively.
    I used the following query but seems there is something missing
    UPDATE ACCOUNT
    SET ACCOUNT_STATUS = CASE  
    WHEN ACCOUNT_STATUS = '004460721' THEN 5 
    WHEN ACCOUNT_STATUS = '042056291' THEN 3 
    WHEN ACCOUNT_STATUS = '601272065' THEN 2 
    WHERE ACCOUNT_ID IN ('004460721','042056291','601272065') 
    My question, is this way correct? if no, can I use CASE WHEN statement and how or I only have choice of using SUB-SELECT to acheive that in one statement?
    What happens when you try it?
    Did you mean "WHEN ACCOUNT_ID = ..."?
    A CASE expressions always needs an END keyword.
    Depending on your requirements (that is, why are those rows being changed, and how do you determine the new values) a CASE expression in an UPDATE statement, similar to what you posted, could be a good way to do it.  MERGE (instead of UPDATE) would also be an option, especially if you want to avoid updating rows that already happen to have the correct values.

  • Any pointer to look into, when buyers cannot change the payment terms

    Any pointer to look into, when buyers cannot change the payment terms on the POs due to the error u201CExpected/Overall value should be equal or greater than invoiced amountu201D
    A thought process to look around, to investage this issue is appreciated.
    Thx/RICK

    Rick,
    this message may be due to the user trying to change a Purchase order item payment terms when there is already a blocked supplier invoice registered for the item.  The vendor invoice payment terms normally override the PO payment terms.  Users sometimes think they can speed up payment to a vendor by changing the payment terms on the PO.  This can only be done before an invoice is registered and the PO term can be overridden at invoice entry time in any case.
    Have a look at the terms on any associated invoice and the vendor record for the Purch org.  
    You may also want to have a look at your business process for blocked invoice resolution.
    If the user wishes to speed up payment of an invoice they need to contact the users who are responsible for the vendor payments.  We call them AP staff in our org - stands for Accounts Payable.
    Hope this helps
    Allen

  • Failover did not happen when network switch went down!!! PLEASE HELP

    Hi gurus,
    Yesterday one disaster struck my RAC database. We have two node cluster and it is 10.2.0.2, both of them located in different sites, yesterday suddenly power went down and the one of the network switch went down and got destructed, node one of RAC database was connected to that switch, but the failover did not happen to the node two as this should be the case when one node goes down the other should be available for all the node one sessions/connections.
    when I tried to ping/telnet the node 1, it was not happening because the switch was down, the network guyz connected the cables to other switch available. When I connected to the node 1, it was showing "Oracle is not available" message.
    And when I tried the other node, it was the same case but I did not see any error in alert log file. Then my TL restarted both the nodes and then the database was available.
    I am very confused that how the failover did not happen and how the database went down, PLEASE suggest something to how to identifiy what was happened. Thanks & Regards
    Edited by: user1221 on Mar 18, 2009 1:09 AM

    About Oracle RAC ... you have 2 nodes ... You have to connect 4 IPs.
    I mean
    - IP public node1
    - IP public node2
    - IP Virtual node1
    - IP Virtual node2
    When node1 down
    You can not ping "IP public node1", but you should ping "- IP Virtual node1", because it should up on node2.
    But not bind 1521 port.
    Idea about failover
    you have to create new difference Service...on RAC Database!
    and on your client have to set TNS to on failover and balance (if you used OCI), you can use TAF feature
    Example:
    DB =
    (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = db01-vip)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = db02-vip)(PORT = 1521)) (FAILOVER=ON)(LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = NEW_SERVICE_DB) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5))))
    If you use JDBC, can not use TAF.
    Anyway, I suggest you read more about RAC on http://otn.oracle.com/rac and http://oracleracsig.org
    Good Luck

  • WHEN-TAB-PAGE-CHANGED  TRIGGER

    Hi all
    Is any way to found examples of
    WHEN-TAB-PAGE-CHANGED trigger
    in forms implementations.
    Any references will be very usefull.
    Thanks a lot,
    Gor

    In the the on-line help Forms' doc there is one :
    In case you cannot find it... here it is:
    Examples /* Use a When-Tab-Page-Changed trigger to dynamically**
    change a tab page's label from lower- to upper-case**
    (to indicate to end users if they already have** navigated to the tab page):*/
    DECLARE
         tp_nm VARCHAR2(30);
         tp_id TAB_PAGE;
         tp_lb VARCHAR2(30);
         BEGIN
              tp_nm := GET_CANVAS_PROPERTY('emp_cvs', topmost_tab_page);
              tp_id := FIND_TAB_PAGE(tp_nm);
              tp_lb := GET_TAB_PAGE_PROPERTY(tp_id, label);
              IF tp_lb LIKE 'Sa%'
                      THEN
                             SET_TAB_PAGE_PROPERTY(tp_id, label, 'SALARY');
              ELSIF tp_lb LIKE 'Va%'
                      THEN
                              SET_TAB_PAGE_PROPERTY(tp_id, label, 'VACATION');
              ELSE
                      null;
              END IF;
    END;Greetings...
    Sim

  • Data missing in Crosstab report with calculated field via case when

    I use the Oracle 10g discoverer. When I create a crosstab report with a calculate field via function case when and put it as datapoint, some of the data is not showing. I tried to not use the case when function for the calculate field, then all the data show.
    I really do not the reason. Could anybody help me out with many thanks?

    Let me explain more.
    I have the original data below.
    Work order, Team, Hours_worked, date
    800001, S1, 5, 2012/01/01
    800001, S1, 15, 2012/01/10
    800001, S2, 4, 2012/01/04
    800002, S1, 3, 2012/01/15
    There are multipul records for the same work order, team on the same day or different.
    Finally I want to set the start date and end date as the parameter to create a crosstab report format like
    start date>=2012/01/01 and close date<=2012/01/05
    Team
    Total hours total hours within the range
    Work order S1 S2 ... S1 S2 ...
    800001 20 4 5 4
    800002 3 0 0 0
    in order to do it, I create two parameters independently start date and close date. Then I create a calculate field hours_worked_withinrange via
    Case when date>=:start date and date<=:end date then Hours_worked else 0 end
    This calculated field is correct in the tabular format report in discoverer desktop. But when I duplicate the list as crosstab. Some data is missing in crosstab data point.
    I checked once I change the calculate field defination not use case when. (For example, C1=hours_worked*2). Then everything runs correct.

  • No Sync when network drive connected

    Hello,
    I have an ipod nano that won't sync through itunes when network drives are mapped.
    I am not trying to sync to the network drive, but just the presence of network drives stops the nano from syncing with itunes.
    As soon as I disconnect the network drives the ipod syncs with itunes fine.
    I have tried this on two different computers and the same thing happens.
    I am using Windows XP-sp2 with the latest itunes (6.0.4) and the latest updates for the ipod.
    Has anyone else experienced this?
    Any workarounds?
    Thank you in advance.
    Chris

    Hi win,
    See this article, in particular the bit about mapped drives and changing the drive letter. Might help.
    http://docs.info.apple.com/article.html?artnum=93499
    Good luck,
    Maz

Maybe you are looking for