Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8922487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:50:55+00:00 2026-06-15T06:50:55+00:00

[Winforms .NET 4.0] I want to be able to call a method and either

  • 0

[Winforms .NET 4.0]

I want to be able to call a method and either return a bool or an object. Or anythign that can satisfy my example.

Example:

Method query the database. If the returned row is null i want the calling method to know this in order to call another check method. If the query returns a row with data i should return the data object.

One way i thought is to use the out keyword. Make the method return bool and initialize the returning object prior to calling the method.

After the method runs i could check if true and then manipuate the object…

Is this a good way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:50:57+00:00Added an answer on June 15, 2026 at 6:50 am

    Method query the database. If the returned row is null i want the calling method to know this in order to call another check method.

    Why not just return a null reference then? Would you ever want null to mean anything else? (For example, would you ever want to represent that a null value has been found, with a different meaning to the value not being found in the first place?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I programmatically create Enter button press in .NET WinForms? I want on
I want to make existing .NET applications (WinForms and WebForms) run on 64-bit machines,
I have a .net WinForms 2.0 application that has an image library of about
WinForms .NET 3.5 We have a contextMenuStrip for data grid. This contextMenuStrip can hold
WinForms, .NET 3.5 I have a ComboBox that needs to display a growing list
I have a datagridview in a c# .net WinForms application that captures order detail
I am writing a WinForms application in C# .NET and want to update the
I have a WinForms application in which I want to be able to provide
I have a .NET Winforms web browser control that is rendering some application information,
Want to deploy and auto-update my .net assembly. But publishing is only for winforms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.