Imports System.Data.SqlClient Namespace MyDataSetTableAdapters Partial Class CustomersTableAdapter Public Sub SetCommandTimeOut(ByVal timeOut As Integer) For Each command As SqlCommand In Me.CommandCollection command.CommandTimeout = timeOut Next End Sub End Class End Namespace
Dim ds As New MyDataSet Dim customersTA As New MyDataSetTableAdapters.CustomersTableAdapter ' Increase time-out to 60 seconds customersTA.SetCommandTimeOut(60000) ' Do the slow query customersTA.FillSlowQuery(ds.Customers)