Non capisco al momento perchè tu abbia la necessità di utilizzare il secondo DataReder all'interno del ciclo del primo DataReder.
Piuttosto farei così:
codice:Comando_SmsGateway.Connection = Connessione_server Comando_SmsGateway.CommandText = "SELECT * FROM INBOX" Comando_SmsGateway.CommandType = CommandType.Text Adapter_SmsGateway.SelectCommand = Comando_SmsGateway Connessione_server.Open() Reader_SmsGateway = Comando_SmsGateway.ExecuteReader() Comando_SmsPanel.Connection = connessione Comando_SmsPanel.CommandText = "SELECT email AS email FROM numeri INNER JOIN email ON email.id_email = numeri.idemail WHERE numero = @DEVICECODE" Comando_SmsPanel.CommandType = CommandType.Text Comando_SmsPanel.Parameters.AddWithValue("@DEVICECODE", DEVICECODE) Adapter_SmsPanel.SelectCommand = Comando_SmsPanel connessione.Open() Reader_SmsPanel = Comando_SmsPanel.ExecuteReader() While Reader_SmsGateway.Read While Reader_SmsPanel.Read() 'Tuo codice End While End While

Rispondi quotando