Hi All,
I am using Linq to SQL dataclass for my website application.
This was working AOK, but then I deleted and recreated the dataclass
(Seemed the simpliest way of updating the class to reflect DB
structure changes).
Since then, I have to declare the connection differently:
DataClassesContext DB = new DataClassesContect(<4 Overloads, expecting
a connection string or object>);
Before, I did not need to pass a connection string or object, I just
did this:
DataClassesContext DB = new DataClassesContect();
This worked Ok, so I can only assume the connection was defined as
class level within the datacontext.
Question is, why did this change - I added the class the same way I
did originally, dragging tables onto the Linq to SQL surface designer
from an SQL connection in server expolorer.
If I do pass in a connection string I get 'object reference not set to
an instance of an object' when ever a query runs.
Any help/ideas much appreciated!
Thanks,
Simon.