Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 Can't access SQL Server DBs from VS Express

Author  Topic 

LarryEvilsizer
Starting Member

2 Posts

Posted - 2007-09-14 : 00:19:41
Hi,

I've installed Visual Studio Express C# and Visual Studio Express Web Designer along with SQL Server. I've downloaded the example databases and have installed them - I can access the databases using the SQL Server tools.

When I try to access any SQL Server databases (specifically the Northwind example DB) via the Add Database Connection dialog in either C# or Web Designer, I get an error box with message "Exception has been thrown by the target of an invocation".

I get this when I manually enter Northwind in the Database Name field; if I try to browse, the whole dialog exits, or, sometimes Visual C# Express crashes. Since the same problem occurs both within C# and Web Designer, I'm assuming the problem is in SQL Server, which is why I'm posting in this forum.

I'm sure I have some configuration problem, and a complete uninstall/reinstall is certainly a possibility, but I'm hoping someone has an idea about how I can around this problem without having to reinstall.

Thanks for your time,
Larry

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-09-15 : 00:11:26
Can you connect to sql with sql tools?
Go to Top of Page

LarryEvilsizer
Starting Member

2 Posts

Posted - 2007-09-20 : 22:47:35

Thanks for your reply, rmiao. Sorry it took so long to get back to you, but I had to go out-of-town and just got home.

I can connect to the database with Microsoft SQL Server Management Studio Express and can do SELECT statements there. I repaired my .NET 2.0 installation, as well as reinstalled C#, VB, Web Designer, and SQL Server Express editions but that did not fix the problem. If I try to add a "SQL Database" template under the "Add New Item" in C# Visual Studio Express, I get an "Unable to find dbProviderFactory for type System.Data.SqlClient.SqlConnection" error.

Really think I've screwed up my .NET installation, but a complete system reinstallation in not feasable right now, so I guess I'm going to have to go with my other RDBMS options.

Again rmiao, thanks for your help.
Larry

Go to Top of Page

mikewa
Microsoft SQL Server Product Team

84 Posts

Posted - 2007-09-21 : 11:29:44
Hi Larry,

SQL Express is working.
VS Express is broken.

Your answer is to get rid of SQL Express??

Have you posted questions about this problem to the VS Express forums on MSDN? (http://forums.microsoft.com/MSDN/default.aspx?SiteID=1) If there is a problem with VS Express, changing database engines isn't going to fix that problem.

Regards,
Mike Wachal
SQL Express

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-09-22 : 23:16:18
Did you apply latest sp and fixes?
Go to Top of Page
   

- Advertisement -