ma il problema delle executereader rimane... ti faccio vedere...
codice:
protected void Page_Load(object sender, EventArgs e)
{
string codim;
codim = Session["idim"].ToString();
SqlCommand cmd = null;
cmd = conn.CreateCommand();
cmd.CommandText = "SELECT ID_VIA FROM PERCORSI_VIE WHERE ID_PERCORSO = "+ codim;
cmd.CommandType = CommandType.Text;
conn.Open();
reader = cmd.ExecuteReader();
if (reader.Read())
{
salvaDati(reader["ID_VIA"].ToString());
}
reader.Close();
conn.Close();
}
protected void salvaDati(String via)
{
String[] array = new String[10];
int i = 0;
array[i] = via;
SelezionaVie(array, i);
}
protected void SelezionaVie(String[] array,int i)
{
reader.Close();
String indPar;
SqlCommand cmd1 = conn.CreateCommand();
cmd1.CommandText = "SELECT Via FROM VIA WHERE ID_Via=" + array[i];
cmd1.CommandType = CommandType.Text;
SqlDataReader reader1 = cmd1.ExecuteReader();
if (reader1.Read())
{
indPar = reader1["Via"].ToString();
}
reader1.Close();
}
qui uso array invece di arraylist ma non credo sia quello il problema...