I want to set the timeout for my DataContext Class
application wide. I can find a lot of examples for C# (1, 2) translated to vb.net
it would be
Partial Class SampleDBDataContext
Inherits System.Data.Linq.DataContext
Partial Private Sub OnCreated()
'Put your desired timeout here.
Me.CommandTimeout = 3600
End Sub
End Class
But it gives the error: Class '<classname1>' must declare a 'Sub New' because its base class '<classname2>' has more than one accessible 'Sub New' that can be called with no arguments.
I have two questions now:
I am just not able to solve the "sub new"
problem. If I put a
Sub New()
End Sub
I get the error that this constructor doesnt exit but I am not sure what existing constructor I should use since I never used a Partial Class
before.
The second is that I am not sure what SampleDBDataContext
I have to use since I have a solution called MySolution where I have a MySolution.SampleDBDataContext
and I also have System.Date.Linq.DataContext
.