Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
  #2 (permalink)  
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
  #3 (permalink)  
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!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:28 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.