I have multiple errors in my project, I don't know if i did it right, but i can't manage to solve them... some solutions?
using System;
using System.Collections.Generic;
//using System.Deployment.Application;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Data;
namespace LoginApplication.Database
{
public partial class DCApp
{
static DCApp __dc = null;
public static DCApp GetDC()
{
{
if (__dc == null)
{
return GetDC(true);
}
return __dc;
}
// end
}
public static DCApp GetDC(bool reset)
{
if (reset)
{
if (__dc != null)
{
__dc.Connection.Close();
__dc.Dispose();
}
__dc = NewDC();
}
return __dc;
// end
}
public static DCApp NewDC()
{
DCApp ndc = new DCApp(Globale.vgSQLDCConnectionString);
ndc.CommandTimeout = 600;
//if (!ApplicationDeployment.IsNetworkDeployed)
//{
// ndc.Log = Console.Out;
//}
//return ndc;
}
public static DateTime GetDate(DCApp _dc)
{
return _dc.ExecuteQuery<DateTime>("SELECT GETDATE()").First();
}
}
}
And here is the Error Log:
Error CS1061 'DCApp' does not contain a definition for 'ExecuteQuery' and no extension method 'ExecuteQuery' accepting a first argument of type 'DCApp' could be found (are you missing a using directive or an assembly reference?)
Error CS0161 'DCApp.NewDC()': not all code paths return a value
Error CS1061 'DCApp' does not contain a definition for 'Connection' and no extension method 'Connection' accepting a first argument of type 'DCApp' could be found (are you missing a using directive or an assembly reference?)
Error CS1061 'DCApp' does not contain a definition for 'Dispose' and no extension method 'Dispose' accepting a first argument of type 'DCApp' could be found (are you missing a using directive or an assembly reference?)
Error CS0103 The name 'Globale' does not exist in the current context
Error CS1061 'DCApp' does not contain a definition for 'CommandTimeout' and no extension method 'CommandTimeout' accepting a first argument of type 'DCApp' could be found (are you missing a using directive or an assembly reference?)
Aucun commentaire:
Enregistrer un commentaire