Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    IndexOutOfRangeException

    cosa vuol dire questo errore?
    Categoria
    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.IndexOutOfRangeException: Categoria


    io faccio una select e i dati recuperati li vorrei scrivere dentro ad un file TXT

    e faccio cosi:

    objReader = objDatabase.SelectSQL("SELECT Prodotti.Titolo, Prodotti.Categoria, Prodotti.Prezzo, News.Titolo, News.Data, News.Id, News.Categoria FROM Prodotti,News WHERE Prodotti.ticker=News.ticker ")

    dim objWriter as New StreamWriter(Server.MapPath("../../public/ticker.txt"), true)
    dim link,ticker as string

    while objReader.read
    if objReader.Item("Categoria")="News" then
    link = "http://www.nomesito.com/news.aspx?id="+objReader.Item("id"
    ticker = objReader.Item("Titolo") + " " + objReader.Item("Data") + " " + link
    else
    link = "http://www.nomesito.com/prodotti.aspx?categoria="+objReader.Item("Categori a"
    ticker = objReader.Item("Titolo") + " " + objReader.Item("Prezzo") + " " + link
    end if
    objWriter.Write(ticker)
    objWriter.WriteLine()
    end while

  2. #2
    ho risolto, era un problema nella query, visto che se nella FROM metto 2 tabelle non funge, ho deciso di fare 2 select diverse e ripetere cosi la stessa operazione per 2 volte.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.