So if i understand correctly it is safe if only one thread at i time is
using it?
I have 50 users on my web application and they all do calls to the
function in the module. Every functions calls the function ExcuteQuery
(here the data-apater is used) that fills the a dataset. The dataset is
returned to the requested function and passed to the Form.
Example:
Public Function GetBedrijf(ByVal bedrijfrelid As Int32) As DataSet
sqlCmd.CommandText = "SELECT DISTINCT TRelatie.RelatieId,
TRelatie.Naam" & _
" FROM TRelatie INNER JOIN" & _
" TRelatieRelatieType ON TRelatie.RelatieId =
TRelatieRelatieType.RelatieId INNER JOIN " & _
" TRelatieType ON
TRelatieRelatieType.RelatieTypeId = TRelatieType.RelatieTypeId " & _
" WHERE TRelatieType.RelatieTypeId = 4 and
bedrijfrelatieid = " & bedrijfrelid & " AND (TRelatieRelatieType.DtVan <
GETDATE()) AND (TRelatieRelatieType.DtTot > GETDATE() OR
TRelatieRelatieType.DtTot IS NULL)" & _
" Order by TRelatie.Naam"
ExecuteSelect("Bedrijf")
Return dsTemp
End Function
Private Sub ExecuteSelect(ByVal tbValue As String)
daAanvraag.SelectCommand = sqlCmd
daAanvraag.SelectCommand.Connection = conAanvraag
If Not daAanvraag.SelectCommand.Connection.State =
ConnectionState.Open Then
daAanvraag.SelectCommand.Connection.Open()
End If
daAanvraag.Fill(dsTemp, tbValue)
daAanvraag.SelectCommand.Connection.Close()
End Sub
Do i have to change the code totally? I did not have complains that it
didnt work correct but i want to make sure to programm it in the correct
manner. So can you please give some examples or a link to examples?
Thnx in advance,
Victor
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!