Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2010, 02:34 PM
Authorized User
 
Join Date: Jul 2010
Posts: 27
Thanks: 2
Thanked 0 Times in 0 Posts
Default TargetInvocationException was unhandled by user code

Hello

can anyone please help me with this issue.

i have finished chapter 4.

When I run the project i get the error - TargetInvocationException was unhandled by user code.

The following line of code is higlighted in yellow:

Code:
objectType.InvokeMember(LoadMethodName, BindingFlags.InvokeMethod, null, listObject, _methodParameters.ToArray());
tha line should load the object.

I think there is a problem in the web.config file.

I have the following settings for the web.config file

Code:
<connectionStrings>
<add name="EAD_ConnString" connectionString="Server=win4zjrzd08qt7; Initial Catalog=EAD;" providerName=""/>
 </connectionStrings>
The EAD_ConnString is a string defined in the DBHelper file and is passed as parameter in the ConnectionStrings method of the ConfigurationManager class as follow

Code:
public class DBHelper
    {
        private const string EAD_CONNSTRING_KEY = "EAD_ConnString";

        public static string GetEADConnectionString()

        {
            return 

ConfigurationManager.ConnectionStrings[EAD_CONNSTRING_KEY].ConnectionString;
        
        }

    }
Please help me if you can as i can not run the application and therefore can not test anything.

Thank you

Regards

MattHoff
 
Old October 10th, 2010, 01:12 PM
Registered User
 
Join Date: Dec 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default same issue

Dear ,
I am facing the same problem would you please guide me how to resolve this issue. Thank you in advance and i am waiting for your reply.
best regards
Zia ul Hassan
 
Old October 13th, 2010, 11:38 AM
Registered User
 
Join Date: Sep 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection String

Try this: Find the DataSource name of you SQL Server.
It might be something like: ZacksPC

then use this for your connection string

<connectionStrings>
<add name="EAD_ConnString" connectionString="Data Source=ZacksPC; Initial Catalog=EAD;Integrated Security=True"/>
</connectionStrings>

Good Luck!




Similar Threads
Thread Thread Starter Forum Replies Last Post
ConstraintException was unhandled by user code jcooper0 BOOK: Professional ASP.NET MVC 2 8 February 16th, 2011 09:32 AM
HttpCompileException was unhandled by user code. error CS0246 fh84 BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 4 October 25th, 2010 12:49 PM
unhandled exception dipakp ASP.NET 2.0 Professional 1 July 6th, 2007 02:16 PM
Reflection-TargetInvocationException dipak_2111 C# 2005 0 January 11th, 2007 01:08 AM
Unhandled Exception: mbarrett C# 3 August 1st, 2003 05:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.