troubles with webserver

R

RG

Hi all,

I have a site with some components in ASP.net (c#). This site is always down
after some time. After that the hosting company has to reset IIS before it
runs again.

Is there something maybe I do wrong with my database and do I use to much
memory or something ?

Pls help me if possible, i come crazy

This is how i use every query to the access database:
///////////////
public static void InsertSQL(string sql)
{
Tools tools = new Tools();
tools.OpenDataSource();
tools.InsertSqlData(sql);
}
///////////////
public OleDbConnection OpenDataSource()
{
//Test if SqlConnection exists
if (m_Connection==null)
{
try
{
m_Connection = new OleDbConnection(ConnectionString);
m_Connection.Open();
}
catch (System.Exception e)
{
throw e;
}
}
else if (m_Connection.State != ConnectionState.Open)
{
m_Connection.ConnectionString = ConnectionString;
try
{
m_Connection.Open();
}
catch (Exception e)
{
throw e;
}
}
return m_Connection;
}
///////////////
public void InsertSqlData(string InsertString)
{
OleDbDataAdapter da = new OleDbDataAdapter();
try
{
da.InsertCommand = new OleDbCommand(InsertString, this.OpenDataSource());
da.InsertCommand.ExecuteNonQuery();
}
catch (Exception e)
{
throw e;
}
finally
{
this.CloseDataSource();
}
}
///////////////
public void CloseDataSource()
{
if (m_Connection!=null)
{
if (m_Connection.State == ConnectionState.Open )
m_Connection.Close();
m_Connection = null;
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top