Travamento no processo

08/08/2005

0

Olá,

Estou tentando desesperadamente resolver um problema que tem ocorrido em um site que estou desenvolvendo em ASP.NET no Delphi 2005. Ainda nao sei o que pode estar ocorrendo, só sei que o site esta funcionando perfeitamente com todas as suas funcionalidades, de repente ele para de funcionar, a pagina fica travada tentando executar o processo asp.net, porem nada aparece na tela. Neste momento a aplicação só volta a funcionar se entrar no painel de controle e reiniciar a aplicacao asp.net ou republicar a dll. Assim ela volta a funcionar. de uns tempos para cá isso tem acontecido diversas vezes, tendo que reiniciar a aplicacão as vezes até 5 vezes ao dia.

Quem puder me ajudar ficarei eternamente grato pois nao tenho ideia do problema. Abaixo um exemplo da pagina inicial:

procedure TWFindex.Page_Load(sender: System.Object; e: System.EventArgs);
begin
  MostrarDestaques();
  MostrarFoto();
  MostrarTodasNot();
  // TODO: Put user code to initialize the page here
end;

procedure TWFindex.MostrarDestaques;
Var
  ReaderMostrarDestaques : OdbcDataReader;
  CommandMostrarDestaques: OdbcCommand;
  sMostrarDestaques : System.Text.StringBuilder;
begin
  sMostrarDestaques := System.Text.StringBuilder.Create();
  sMostrarDestaques.Append(´SELECT noticia.noticia_id, noticia.noticia_titulo, ´ +
    ´noticia.noticia_resumo, destaque_noticia.destaque_local FROM noticia, destaque_noticia ´ +
    ´WHERE noticia.noticia_id = destaque_noticia.noticia_id AND destaque_pagina = "index.aspx"´);
  CommandMostrarDestaques := OdbcCommand.Create(sMostrarDestaques.ToString(), Connection);
  try
    Connection.Open();
    ReaderMostrarDestaques := CommandMostrarDestaques.ExecuteReader();
    While ReaderMostrarDestaques.Read() do begin
          if ReaderMostrarDestaques.Item[´destaque_local´].ToString = ´Notícia 1´ then begin
            noticiadestaqueid := ReaderMostrarDestaques.Item[´noticia_id´].ToString;
            noticia1t.Text := ReaderMostrarDestaques.Item[´noticia_titulo´].ToString;
            noticia1t.NavigateUrl := ´detnoticia.aspx?id=´ + noticiadestaqueid;
            noticia1txt.Text := ReaderMostrarDestaques.Item[´noticia_resumo´].ToString;
          end
          else if ReaderMostrarDestaques.Item[´destaque_local´].ToString = ´Notícia 2´ then begin
            noticia2t.Text := ReaderMostrarDestaques.Item[´noticia_titulo´].ToString;
            noticia2t.NavigateUrl := ´detnoticia.aspx?id=´ + ReaderMostrarDestaques.Item[´noticia_id´].ToString;
            noticia2txt.Text := ReaderMostrarDestaques.Item[´noticia_resumo´].ToString;
          end
          else if ReaderMostrarDestaques.Item[´destaque_local´].ToString = ´Notícia 3´ then begin
            noticia3t.Text := ReaderMostrarDestaques.Item[´noticia_titulo´].ToString;
            noticia3t.NavigateUrl := ´detnoticia.aspx?id=´ + ReaderMostrarDestaques.Item[´noticia_id´].ToString;
            noticia3txt.Text := ReaderMostrarDestaques.Item[´noticia_resumo´].ToString;
          end
          else if ReaderMostrarDestaques.Item[´destaque_local´].ToString = ´Notícia 4´ then begin
            noticia4t.Text := ReaderMostrarDestaques.Item[´noticia_titulo´].ToString;
            noticia4t.NavigateUrl := ´detnoticia.aspx?id=´ + ReaderMostrarDestaques.Item[´noticia_id´].ToString;
            noticia4txt.Text := ReaderMostrarDestaques.Item[´noticia_resumo´].ToString;
          end
    end;
    ReaderMostrarDestaques.Close();
    Connection.Close();
  except
    if Connection.State = ConnectionState.Open then begin
      Connection.Close();
    end
  end;
end;

procedure TWFindex.MostrarFoto;
Var
  ReaderMostrarFoto : OdbcDataReader;
  CommandMostrarFoto: OdbcCommand;
  sMostrarFoto : System.Text.StringBuilder;
begin
  sMostrarFoto := System.Text.StringBuilder.Create();
  sMostrarFoto.Append(´SELECT noticia_foto.fotonot_arquivo, noticia_foto.fotonot_credito ´ +
  ´FROM noticia_foto, noticia WHERE noticia.noticia_fotodestaque = noticia_foto.fotonot_id ´ +
  ´AND noticia.noticia_id = ´ + noticiadestaqueid);
  CommandMostrarFoto := OdbcCommand.Create(sMostrarFoto.ToString(), Connection);
  try
    Connection.Open();
    ReaderMostrarFoto := CommandMostrarFoto.ExecuteReader();
    ReaderMostrarFoto.Read();
    IMGDestaque.ImageUrl := ´imagensbd/282/´ + ReaderMostrarFoto.Item[´FOTONOT_ARQUIVO´].ToString;
    lcredito.Text := ReaderMostrarFoto.Item[´FOTONOT_CREDITO´].ToString;
    ReaderMostrarFoto.Close();
    Connection.Close();
  except
    if Connection.State = ConnectionState.Open then begin
      Connection.Close();
    end
  end;
end;

procedure TWFindex.MostrarTodasNot;
Var
  ReaderTodasNoticias : OdbcDataReader;
  CommandTodasNoticias: OdbcCommand;
  sTodasNoticias : System.Text.StringBuilder;
begin
  sTodasNoticias := System.Text.StringBuilder.Create();
  sTodasNoticias.Append(´SELECT NOTICIA_ID, NOTICIA_DTCAD, NOTICIA_TITULO FROM ´ +
    ´noticia ORDER BY noticia_dtcad DESC, noticia_id DESC LIMIT 0,5´);
  CommandTodasNoticias := OdbcCommand.Create(sTodasNoticias.ToString(), Connection);
  try
    Connection.Open();
    ReaderTodasNoticias := CommandTodasNoticias.ExecuteReader();
    DGNoticias.DataSource := ReaderTodasNoticias;
    DGNoticias.DataBind();
    ReaderTodasNoticias.Close();
    Connection.Close();
  except
    if Connection.State = ConnectionState.Open then begin
      Connection.Close();
    end
  end;
end;


[color=green:36c4e5b324]Movido de Delphi para ASP.NET[/color:36c4e5b324]


Rzcoimbra

Rzcoimbra

Responder

Que tal ter acesso a um e-book gratuito que vai te ajudar muito nesse momento decisivo?

Ver ebook

Recomendado pra quem ainda não iniciou o estudos.

Eu quero
Ver ebook

Recomendado para quem está passando por dificuldades nessa etapa inicial

Eu quero

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar