CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Faltering Windows support
  • Internet Explorer 8 Click Clever Click Safe
  • Release Candidate 2 for ASP.NET MVC 2
  • Learn How to Create Dual Mode Windows Services

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > .NET Programming > C-Sharp Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    C-Sharp Programming Post questions, answers, and comments about C#.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old October 12th, 2009, 09:16 AM
    Zero1UP Zero1UP is offline
    Junior Member
     
    Join Date: Feb 2009
    Posts: 7
    Zero1UP is an unknown quantity at this point (<10)
    Stopping a database Reader

    When the form closes I need the reader to stop otherwise even after I end debugging it's still connected to the emulator

    What I have so far
    Code:
    public frm_rfid_reader()
            {
                InitializeComponent();
                this.Closing += new CancelEventHandler(frm_rfid_reader_Closing);
            }
    
     private void frm_rfid_reader_Closing(object sender, System.ComponentModel.CancelEventArgs e)
            {
    
                }
    This is what I had in vb.net that worked:

    Code:
     Private Sub frmReader_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
            ' Disconnects from external software
            Me.mReader.Disconnect()
            Me.Dispose()
            Application.Exit()
        End Sub
    I can't seem to figure out the equivelent in C# because I tried that above and I end up with this error

    Error 1 Only assignment, call, increment, decrement, and new object expressions can be used as a statement
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > .NET Programming > C-Sharp Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 08:16 AM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.