Error: The name 'SqlHelper' does not exist...
In VS 2005, C#, ASP.NET 3.0, I am getting the following error when trying to build my solution:
Error 1 The name 'SqlHelper' does not exist in the current context d:\work\cwork\pool\pooling\pooling\pooling.cs 25 28 pooling
It's a simple console application test solution with only 2 cs files:
pooling.cs
SqlHelper.cs
SqlHelper is supposed to be a class file.
Pooling.cs contains the main method as follows:
**********
static void Main(string[] args)
{
while (true)
{
// error line
SqlDataReader dr = SqlHelper.ExecuteReader(connString,
CommandType.Text, "select date = getdate()");
// error line
if (dr != null)
{
while (dr.Read())
{
Console.WriteLine(dr["date"].ToString());
}
dr.Close();
}
Console.WriteLine("Press Enter to continue...\n");
Console.ReadLine();
}
}
********
In the SqlHelper.cs file, the class is as follows:
********
using .....;
namespace pooling
{
public class SqlHelper
{
private static Int32 NUM_TRIES ;
private const Int32 MAX_TRIES = 32;
static SqlHelper()
{
NUM_TRIES = 0;
}
//VARIOUS CODE
}
*********
How can I make SqlHelper 'visible' to the pooling.cs file?
Many thanks
Mike Thomas

