1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| dim SQLCON as new sqlclient.connection
Dim SQLCMD As New SqlClient.SqlCommand
Dim SQLDA As SqlClient.SqlDataAdapter
dim SCmd as string
scmd = "le texte de la requête"
'créer et ouvrir la connection
SQLCMD.Connection = SQLCON
SQLCMD.CommandText = SCmd
SQLCMD.CommandType = CommandType.Text
SQLCMD.CommandTimeout = (pas obligatoire, par défaut 0 ou une valeur)
SQLDA = New SqlClient.SqlDataAdapter
SQLDA.SelectCommand = SQLCMD
Try
SQLDA.Fill(Table)
Catch ex As Exception
Throw New Exception(String.Format("Erreur Chargement table : {0}", Table.TableName), ex)
end try |
Partager