CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: [RESOLVED] Need Help on this Bank Program!

    Quote Originally Posted by rocky_upadhaya View Post
    What I want to do is open that new form on top of existing form.
    I think this should be enough:
    Code:
    frm2.StartPosition = FormStartPosition.CenterParent; // here you can choose the start position
    frm2.ShowDialog(this); // shows the form as a modal window, this means you cannot switch to the main form until you close it
    Last edited by memeloo; January 4th, 2010 at 03:33 PM.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  2. #17
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Re: Need Help on this Bank Program!

    Thanks for your constant support but the piece of code posted by you contains bug. Now It shows error at the compile time. Also if this code was to run it would delete 'accountToDelete' which is a copy of selected a. What i wanted to do is delete the selected 'a' from the List ie Delete the Account Premanently.

    Type Of Error Showed:

    Argument '1': cannot convert from 'System.Collections.Generic.IEnumerable<WindowsFormsApplication1.Account1>' to 'WindowsFormsApplication1.Account1' C:\Documents and Settings\Munni\My Documents\Visual Studio 2008\Projects\Bank\WindowsFormsApplication1\Initial.cs 75 39 Bank

  3. #18
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: Need Help on this Bank Program!

    can you upload your updated bank program with the latest changes?
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  4. #19
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: [RESOLVED] Need Help on this Bank Program!

    Quote Originally Posted by memeloo View Post
    Code:
    public static bool DeleteAccount(int id, string pass)
    {
       var accountToDelete =
          from a in AccountList
          where a.Account_ID == id && a.Pass == pass
          select a;
       return AccountList.Remove(accountToDelete);
    }
    The linq query is return a IEnumarble<T> in this case

    try
    Code:
    public static bool DeleteAccount(int id, string pass)
    {
       var accountToDelete =
          (from a in AccountList
          where a.Account_ID == id && a.Pass == pass
          select a).FirstOrDefault();
       return AccountList.Remove(accountToDelete);
    }
    Not sure what happens here if accountToDelete is null. Try and see if there does not occure an error.

  5. #20
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Re: Need Help on this Bank Program!

    Thanks Worked Perfectly!! I have also posted updated bank Program at the top of the first page and is named Updated_Bank.zip I will still spending much of my time on this Program so will be expecting help from both of you guys. cheers!!

  6. #21
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Re: Need Help on this Bank Program!

    I have worked my way up and almost finished this program But the last thing that is giving me a headache is adding Transfer Money Facility. for this 2 id values and 1 amount value needed to be passed to [public static Account1 TranM(int id1, int id2, int amount)] method .
    This method needs to subtract amount from balance with Account id id1 and add it to account with id id2.......

  7. #22
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Re: Need Help on this Bank Program!

    Now that I have finally Finished this Bank Program! I want to thank Memelo and dannystommen for helping me on this program. I wanted to learn C# through practical approach and quiet Succeeded on that I will now post the final release of Bank Program so that other Beginner programmer of C# could take refrence of it. The Bank.zip You see on the first program is the final one. And If You download it and go through it so that you get better way for doing anything please kindly post on this forum thread. Thank You!!!

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured