Torna al Thread

Public Function CaricaPresenti(ByVal ObjSchedinaPs As PropertySchedinePS) As SchedinePSCollection Dim SchedinaPSColl As New SchedinePSCollection Try SqlCmd.CommandText = "GetPresenti" SqlCmd.Parameters.Add("@Codalbergo", SqlDbType.Int).Value = ObjSchedinaPs.CodAlbergo SqlCmd.Connection = Db SqlCmd.CommandType = CommandType.StoredProcedure SqlDr = SqlCmd.ExecuteReader While SqlDr.Read() ObjSchedinaPs = New PropertySchedinePS ObjSchedinaPs.NumeroSchedina = SqlDr.GetSqlInt32(0).Value ObjSchedinaPs.CodAlloggiato = SqlDr.GetSqlInt32(1).Value ObjSchedinaPs.IdComponente = SqlDr.GetSqlInt32(2).Value ObjSchedinaPs.CognomeAlloggiato = SqlDr.GetSqlString(3).Value ObjSchedinaPs.NomeAlloggiato = SqlDr.GetSqlString(4).Value ObjSchedinaPs.DataArrivo = SqlDr.GetSqlDateTime(5).Value ObjSchedinaPs.AnnoGestionale = SqlDr.GetSqlInt32(6).Value SchedinaPSColl.Add(ObjSchedinaPs) End While 'Leggi il set di record successivo SqlDr.NextResultset '---Qui gestisci il valore ritornato dalla Stored Procedure come vuoi (sarà sempre in integer singolo) Return SchedinaPSColl Catch ex As Exception Throw ex Finally SqlDr.Close() SqlCmd.Parameters.Clear() SqlCmd.Dispose() End Try End Function
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5