1

我在定期从数据库中获取数据时遇到了一些麻烦。我有一个连接到我的服务器的客户端列表。我需要使用查询从我的数据库中检索选定的数据。

我的函数返回一个 MySqlDataAdapter 并将字符串作为参数。我在客户的线程中使用我的函数。这是我的功能:

Function TachesEnvoi(ByVal idClient As String) As MySqlDataAdapter
        MyTachesEnvoi.Connectionstring = RequeteConnBDD
        MyTachesEnvoi.Open()

            Dim StrTachesEnvoi As String = "select * from alertes 
            where id_alerte IN (select Alertes_id_Alerte FROM bddalertes.alertehisto 
            WHERE id_histo IN (select alertehisto_id_histo from tachesenvoi where traite = 0 and Utilisateur_id_Utilisateur ='" & idClient & "'));"

            Dim CmdTachesEnvoi As New MySqlCommand(StrTachesEnvoi, MyTachesEnvoi)
            Dim AdaptateurTachesEnvoi As New MySqlDataAdapter(CmdTachesEnvoi)
            CmdTachesEnvoi.Dispose()
            MyTachesEnvoi.Close()
            Console.WriteLine("fin de tachesenvoi")

            Return AdaptateurTachesEnvoi

    End Function

我试图用计时器检查解决方案,但我没有设法做到这一点..

我不知道如何做到这一点,如果有人知道我会很高兴,并感激不尽!X)

(对不起我的英语,法国人)

4

0 回答 0