'System.Data.Linq.DataContext' does not contain a constructor that takes 0 arguments
using System; using System.Data; using System.Configuration; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.Linq.Mapping; using System.Data.Linq; using System.Reflection; namespace WcfService5 { public class Singleton : DataContext { private static Singleton _instance = null; private static Object _mutex = new Object(); static String connection; private Singleton(String connectionString) { // whatever } public static Singleton GetInstance(String ConnectionString) { if (_instance == null) { lock (_mutex) // now I can claim some form of thread safety... { if (_instance == null) { _instance = new Singleton(ConnectionString); } } } return _instance; } [Function(Name = @"GetEmpByNames", IsComposable = false)] public ISingleResult<myems> getCustomerAll([Parameter(DbType = "Nvarchar(50)")] string Ename, [Parameter(DbType = "Int")] Int32 Eno) { IExecuteResult objResult = this.ExecuteMethodCall(this, (MethodInfo)MethodInfo.GetCurrentMethod(), Ename, Eno); ISingleResult<myems> objresults = (ISingleResult<myems>)objResult.ReturnValue; return objresults; } } }
... : base({arguments the base class constructor wants})
public Singleton(String connectionString): base(connectionString) { // whatever }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)