Hi,
presently i am developing windows forms.it shows the following error.please correct it.
Error1:Program 'D:\PetStore\PetStoree.PSDataLayer\obj\Debug\PetStoree.PSDataLayer.exe' does not contain a static 'Main' method suitable for an entry point PetStoree.PSDataLayer
namespace PetStoree.PSDataLayer
{
public static class DBConnection
{
static string provider = ConfigurationManager.AppSettings["provider"].ToString();
static string conStr = ConfigurationManager.AppSettings["CnStr"].ToString();
public static DbConnection connection = null;
public static DbCommand command = null;
static DbProviderFactory factory;
public static DbConnection GetConnection()
{
string provider = ConfigurationManager.AppSettings["provider"].ToString();
string conStr = ConfigurationManager.AppSettings["petstore09"].ToString();
DbProviderFactory factory = DbProviderFactories.GetFactory(provider);
DbConnection connection = factory.CreateConnection();
connection.ConnectionString = conStr;
return connection;
}
public static void CloseConnection()
{
if (connection != null)
connection.Close();
}
public static DbCommand GetCommand()
{
string provider = ConfigurationManager.AppSettings["provider"].ToString();
factory = DbProviderFactories.GetFactory(provider);
DbCommand command = factory.CreateCommand();
command.Connection = connection;
return command;
}
public static DbDataAdapter GetDataAdapter()
{
DbDataAdapter dda = factory.CreateDataAdapter();
return dda;
}
public static DbParameter GetDataParameter()
{
DbParameter dp = factory.CreateParameter();
return dp;
}
}
}
Best,
Sudheep.