Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 232203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:59:50+00:00 2026-05-11T19:59:50+00:00

I am getting this error while trying to connect my web site. Unspecified error

  • 0

I am getting this error while trying to connect my web site.

Unspecified error Description: An
unhandled exception occurred during
the execution of the current web
request. Please review the stack trace
for more information about the error
and where it originated in the code.

Exception Details:
System.Data.OleDb.OleDbException:
Unspecified error.

Maybe I am doing something wrong while opening and closing connections. I always get this error if 5-10 user enter same time to site. When a user enter site I am updating or inserting new records for statistics.

I am using db class for connect:

  public OleDbConnection baglan()
{
    OleDbConnection baglanti = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("~/App_Data/manisaweb.mdb"));
    baglanti.Open();
    return (baglanti);
}
   //********************************************************************
//Sql Sorgu Çalıştırma
public int cmd(string sqlcumle)
{
    OleDbConnection baglan = this.baglan();
    OleDbCommand sorgu = new OleDbCommand(sqlcumle, baglan);
    int sonuc = 0;

    try
    {
        sonuc = sorgu.ExecuteNonQuery();
    }
    catch (OleDbException ex)
    {
        throw new Exception(ex.Message + " (" + sqlcumle + ")");
    }
    finally
    {
        sorgu.Connection.Close();
    }
    return (sonuc);
}
//********************************************************************
//Kayıt Sayısı Bulma
public string GetDataCell(string sql)
{
    DataTable table = GetDataTable(sql);
    if (table.Rows.Count == 0)
        return null;
    return table.Rows[0][0].ToString();
}

//Kayıt Çekme
public DataRow GetDataRow(string sql)
{
    DataTable table = GetDataTable(sql);
    if (table.Rows.Count == 0) return null;
    return table.Rows[0];

}

//DataTable ye veri çekme
public DataTable GetDataTable(string sql)
{
    OleDbConnection baglan = this.baglan();
    OleDbDataAdapter adapter = new OleDbDataAdapter(sql, baglan);
    DataTable dt = new DataTable();

    try
    {
        adapter.Fill(dt);

    }
    catch (OleDbException ex)
    {
        throw new Exception(ex.Message + " (" + sql + ")");
    }
    finally
    {
        adapter.Dispose();
        baglan.Close();
    }
    return dt;
}

//Datasete veri çekme
public DataSet GetDataSet(string sql)
{
    OleDbConnection baglan = this.baglan();
    OleDbDataAdapter adapter = new OleDbDataAdapter(sql, baglan);
    DataSet ds = new DataSet();
    try
    {
        adapter.Fill(ds);
    }
    catch (OleDbException ex)
    {
        throw new Exception(ex.Message + " (" + sql + ")");
    }
    finally
    {
        ds.Dispose();
        adapter.Dispose();
        baglan.Close();
    }
    return ds;
}

And for STATISTICS in main.master.cs every page_load event

public void Istatistik()
{


    string IpAdres = Request.ServerVariables["REMOTE_ADDR"].ToString();//Ip Adresini alıyoruz.
    string Tarih = DateTime.Now.ToShortDateString();
    lblOnlineZiyaretci.Text = Application["OnlineUsers"].ToString();//Online ziyaretçi

    //Ogüne Ait Hit Bilgi Güncelleme
    DataRow drHit = GetDataRow("Select * from SayacHit Where Tarih='" + Tarih + "'");
    if (drHit == null)
    {
        //Bugüne ait kayıt yoksa bugunün ilk siftahını yap
        cmd("Insert into SayacHit(Tarih,Tekil,Cogul) values('" + Tarih + "',1,1)");
    }
    else
    {

        string SayfaAdi = Page.ToString().Replace("_aspx", ".aspx").Remove(0, 4); //Sayfa adını alıyoruz.
        if (SayfaAdi == "default.aspx")//Güncelleme işlemini sadece anasayfadaysa yapıyoruz
        {
            //Bugüne ait kayıt varsa Çoğulu 1 artırıyoruz.
            cmd("Update SayacHit set Cogul=Cogul+1 Where Tarih='" + Tarih + "'");
        }

        //Tekil artımı için önce Ip kontrolü yapıyoruz.
        DataRow drIpKontrol = GetDataRow("select * from SayacIp Where Ip='" + IpAdres + "'");
        if (drIpKontrol == null)
        { //Eğer ip yoksa tekilide artırabiliriz. Ip kayıtlı ise artırma işlemi yapmıyoruz.
            cmd("Update SayacHit set Tekil=Tekil+1 Where Tarih='" + Tarih + "'");
        }
    }


    //Giren Kişinin IP sini Kaydetme
    DataRow drIp = GetDataRow("Select * from SayacIp Where Ip='" + IpAdres + "'");
    if (drIp == null)
    {
        cmd("Insert into SayacIp(Ip,Tarih) values('" + IpAdres + "','" + Tarih + "')");
    }


    //Ekrana Bilgileri Yazdırabiliriz
    DataRow drSonuc = GetDataRow("Select * from SayacHit Where Tarih='" + Tarih + "'");
    lblBugunTop.Text = drSonuc["Cogul"].ToString();
    //lblBugunTekil.Text = drSonuc["Tekil"].ToString();
    //Dün Bilgilerini Çekme
    //DataRow drDun = GetDataRow("Select * from SayacHit Where Tarih='" + DateTime.Now.AddDays(-1).ToShortDateString() + "'");
    DataRow drGenel = GetDataRow("Select SUM(Tekil) as Toplam from SayacHit");
    //if (drDun != null)
    //{
    //    lblDunTop.Text = drDun["Tekil"].ToString();
    //}
    //else
    //{
    //    lblDunTop.Text = "0";
    //}

    lblGenelTop.Text = drGenel["Toplam"].ToString();
    lblIPAdresi.Text = IpAdres;
}

And then there is 2 section in Default.aspx; it loads at the page load event for news and articles.

    db veri = new db();

    rptNews.DataSource = veri.GetDataTable("select top 5 KullaniciAdiSoyadi,Ozet,Baslik,Tarih,IcerikID,Icerik from Icerik a inner join Kullanici d on a.KullaniciID=d.KullaniciID where KategoriID = 1 and Durum = 1 Order by IcerikID Desc ");
    rptNews.DataBind();
    rptArticle.DataSource = veri.GetDataTable("select top 5 Ozet,Baslik,Tarih,IcerikID,Icerik from Icerik where KategoriID = 2 and Durum = 1 Order by IcerikID Desc ");
    rptArticle.DataBind();

So there is so many UPDATE, INSERT and SELECT queries in every page load event. If this is my problem, is there another way of doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:59:50+00:00Added an answer on May 11, 2026 at 7:59 pm

    I would second Henk’s #2 suggestion: failure to properly close database connections. If you are using DataSets or DataReaders, sending inline SQL or calling stored procedures, you must close the connections in code when you are through with them. If you don’t close the connection, the number of available connections is gradually maxed out, and no new database requests can be made. It is only after enough users’ sessions time out and the connections are released that other users can obtain a connection.

    You have the exact symptom of unclosed connections: everything works fine for the first few users. But gradually, as more users log in, or as the original users move about the web app, opening ever more database connections, that everything locks up.

    One way to diagnose this would be to use a database profiler tool (Profiler for SQL Server) to examine the database connections as they are opened and closed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 165k
  • Answers 165k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Categories extend the original class, but they don't subclass it,… May 12, 2026 at 12:54 pm
  • Editorial Team
    Editorial Team added an answer Haven't tested this, but it's something like: RewriteRule \.php$ -… May 12, 2026 at 12:54 pm
  • Editorial Team
    Editorial Team added an answer "0:0:0:0:0:0:0:1" is the IPv6 loopback address as defined in RFC… May 12, 2026 at 12:54 pm

Related Questions

I am getting this error when running ./manage.py migrate app_name While loading migration 'whatever.0001_initial':
I am trying to merge multiple excel files using DataTable.Merge() option For Each fileName
I am trying to reuse an sqlite statement in my application in a method.
I am writing a simple program, which is trying to find next palindrome number

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.