Custom Error Handler Vb.net
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Developing with Visual Studio .NET Articles and Columns Visual Basic .NET Articles Visual Basic .NET Articles Introduction to Exception Handling in Visual Basic .NET Introduction to Exception Handling in Visual Basic .NET Introduction to Exception Handling in Visual Basic .NET Accessing the Registry with Visual Basic .NET Adding New Features with User Controls Advanced Features in Visual Basic .NET and Testing for Scalability Around the World with Visual Basic Aspect-Oriented Programming Asynchronous Execution in Visual Basic .NET Asynchronous Method Execution Using Delegates Automatically Generating Proxy Classes Automatically Generating a Web Service Automating COM+ Administration Best Practices for Windows Forms Applications Building an Attribute Documenter and Viewer Building a Progress Bar that Doesn't Progress Calling All Operators Can I Interest You in 5000 Classes? COM+ and MTS, DCOM and MSMQ, Serialization in .NET Compile Options, Loading Images into PictureBoxes, Deploying .NET Apps, and More Create a Graphical Editor Using RichTextBox and GDI+ Creating A Breadcrumb Control Creating a Five-Star Rating Control Creating and Managing Secondary Threads Creating a Product Search Application Using the eBay SDK and Visual Basic .NET Creating Markup Text in Visual Basic .NET Creating Your Own Dynamic Properties and Preserve Property Settings in Visual Basic .NET Data Binding Radio Buttons to a List Data Binding in Visual Basic .NET Deploying Hybrid Visual Basic 6.0 / Visual Basic .NET Applications Deployment Changes in Visual Basic .NET Deploying Assemblies Design an Application Migration Strategy for Visual Basic 6.0 to Visual Basic 2005 Designing With Custom Attributes Diagnose This: Launching and Controlling System Processes with Visual Basic 6 and the .NET Framework Digital Grandma Doing Async the Easy Way Don't Freak Out About Visual Studio Enterprise Services, SQL
Websites Community Support ASP.NET Community Standup ForumsHelp Web Forms:Guidance Videos Samples Forum Books Open Source Older Versions - Getting Started Getting StartedGetting Started with ASP.NET 4.5 Web Forms and Visual Studio 20131. Getting Started with Web Forms and Visual Studio2. Create the Project3. Create the Data Access Layer4. UI and Navigation5. Display Data Items and Details6. Shopping Cart7. Checkout and Payment https://msdn.microsoft.com/en-us/library/aa289505(v=vs.71).aspx with PayPal8. Membership and Administration9. URL Routing10. ASP.NET Error HandlingIntroduction to ASP.NET Web FormsCreating a Basic Web Forms Page in Visual Studio 2013Creating ASP.NET Web Projects in Visual Studio 2013Code Editing ASP.NET Web Forms in Visual Studio 2013ASP.NET Scaffolding in Visual Studio 2013ASP.NET Web Forms (dotnetConf 2014)Using Page http://www.asp.net/web-forms/overview/older-versions-getting-started/deploying-web-site-projects/displaying-a-custom-error-page-vb Inspector for Visual Studio 2012 in ASP.NET Web FormsVisual Studio 2012 Hands On LabsWhat's New in ASP.NET and Web Development in Visual Studio 2012What's New in Web Forms in ASP.NET 4.5Using Page Inspector in Visual Studio 2012Monitoring and TelemetryRoutingASP.NET 4 - RoutingASP.NET 4 - Defining RoutesASP.NET 4 - Constructing URLs from RoutesASP.NET 4 - Accessing URL Parameters in a PageJavaScript and Client FrameworksASP.NET 4 - Microsoft Ajax OverviewASP.NET AJAX Control Toolkit (maintained by DevExpress)Working with Data Getting Started with ASP.NET 4.5 Web FormsModel Binding and Web Forms in Visual Studio 20131. Retrieving and Displaying Data2. Updating, Deleting, and Creating Data3. Sorting, Paging, and Filtering Data4. Integrating JQuery UI Datepicker5. Using Query String Values to Filter Data6. Adding Business Logic LayerASP.NET 4 Web Forms - Validating User Input in a PageASP.NET 4 Web Forms - State ManagementASP.NET Data Access - Recommended ResourcesServer Data Control
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack http://stackoverflow.com/questions/14452054/vb-net-exception-handling-for-something-that-returns-a-data-set-instead-of-strin Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up VB.NET Exception Handling for Something that Returns a Data Set instead of String up vote custom error 0 down vote favorite My program is throwing an error I should handle. But I cannot return a string message because the it is a function that returns a dataset. Public Function getUserInfo(ByValue testUserIdAs String) As DataSet Dim dsUseInfo As DataSet = New DataSet() Try Dim objTestWs As New TestWebService.UserMaintenanceSoapClient dsUseInfo = objTestWs.dsGetUserInfo(TestOU, PAC, paramUserID) Return (dsUseInfo) Catch ex As Exception ' TEST FIX ERROR HANDLING -LIWM Please search how to custom error handler return custom error. I want to return "userid already exists" Throw End Try I was thinking of putting If error then return "Error Message" but I can't return it as type string . Please help. vb.net exception types exception-handling dataset share|improve this question edited Nov 12 '15 at 21:48 Brian Tompsett - 汤莱恩 3,083112675 asked Jan 22 '13 at 5:20 Kaycee Enerva 624 You're throwing an exception in your catch block, so you won't be returning the dataset. Simply include the error message you want when you throw the exception, e.g. throw new Exception("User not found");. Not the most elegant solution, but it will get you what you want. –Tim Jan 22 '13 at 5:23 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote It looks like you don't really know what to do with the exception in getUserInfo and just want to pass it on to the outer function. Well, here's the great thing about exceptions: They are passed on automatically! There's nothing you need to do, and, in particular, you do not need to use the return value of the function for that. Just don't catch the exception until you know what to do with it. For example, in your ca