Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    258

    variabile locale non assegnata

    ho un problema con l'assegnazione d una variabile.
    Il codice è questo

    string query_exp;
    if (lblExhId.Text=="")
    {
    query_exp="Select ExhFrd,ExhTod,ExhPrg,ExhCmp,ExhInq,ExhLev,ExhCnt,E xhNot,ExhOwnId from Exh where ExhAnaId="+ Convert.ToInt32(Session["idana"]);
    }
    if(Session["prev-next"].ToString()=="next")
    {
    query_exp="Select ExhFrd,ExhTod,ExhPrg,ExhCmp,ExhInq,ExhLev,ExhCnt,E xhNot,ExhOwnId from Exh where ExhOwnId>"+ Convert.ToInt32(lblExhId.Text) +" and ExhAnaId="+ Convert.ToInt32(Session["idana"]);
    }
    if (Session["prev-next"].ToString()=="prev")
    {
    query_exp="Select ExhFrd,ExhTod,ExhPrg,ExhCmp,ExhInq,ExhLev,ExhCnt,E xhNot,ExhOwnId from Exh where ExhOwnId<"+ Convert.ToInt32(lblExhId.Text) +" and ExhAnaId="+ Convert.ToInt32(Session["idana"]);
    }

    SqlDataReader dr_exp;
    SqlCommand cmd_exp=new SqlCommand(query_exp,conn);
    Mi dice :
    Utilizzo della varibile locale query_exp non asseganto

    ste

  2. #2
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    258
    niente già risolto bastava mettere else if

    grazie
    ste

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 © 2026 vBulletin Solutions, Inc. All rights reserved.