i am trying to make a c# console application my basic objective its to be cheking a "status" field in mysql database it is on a server... i tried it but after 20 min approximatly it gives me a timeout error... is there a way i can do this permanently?? thanks in advanced... this is something i have so you have an idea.
namespace blabla
{
class Program
{
static void Main(string[] args)
{
int flag = 0;
while (flag < 1)
{
string connstr = "Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword";
MySqlConnection conn = new MySqlConnection(connstr);
MySqlCommand command = conn.CreateCommand();
command.CommandText = "select * from table where status = 1 ";
conn.Open();
try
{
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
MySqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
// do things
}
conn.Close();
}
}
}