views:

445

answers:

2

Im trying to add a connection to a database in SQL Server 2008 using Visual Studio 2008. When testing the connection, it says that it is successful. However, once I said okay, it complains and say: "Cannot add data connection. Object reference not set to an instance of an object."

How do I go about adding a data connection to a SQL Server 2008 using Visual Studio 2008?

+1  A: 

Via code would be something like:

var conn = new SqlConnection([connectionString]);
conn.Open();
KiwiBastard
A: 

"Object reference not set to an instance of an object" is usually an indicator of not using the Keyword "New".

Eppz