re:
I would like to do sth like that (e.g. in the Page_Load event):
P_RWI_PAYMENTS_SEARCHTableAdapter.SelectCommandTimeout = 180
but this TableAdapter is not seen in IntelliSense.
It's simpler to set the Timeout in code :
<DataObjectMethod(DataObjectMethodType.Delete)> _
Public Shared Function DeleteEmployee(EID As Integer) As Boolean
If Not _initialized Then Initialize()
Dim conn As SqlConnection = New SqlConnection(_connectionString)
Dim cmd As SqlCommand = New SqlCommand("DELETE FROM E WHERE EID = @EmployeeID", conn)
cmd.CommandTimeout = 20
cmd.Parameters.Add("@EmployeeID", SqlDbType.Int).Value = EID
Try
conn.Open()
If cmd.ExecuteNonQuery() <> 0 Then _
Return False
Catch e As SqlException
' Handle exception.
Finally
conn.Close()
End Try
Return True
End Function
Juan T. Llibre, asp.net MVP
aspnetfaq.com :
http://www.aspnetfaq.com/
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
===================================
Piotrek said:
Thanks for all answers.
I created a partial class, in which there is a SelectCommandTimeout
property:
namespace DataSetPaymentsTableAdapters
{
public partial class P_RWI_PAYMENTS_SEARCHTableAdapter
{
public int SelectCommandTimeout
{
get
{
return (this._commandCollection[0].CommandTimeout);
}
set
{
for (int i = 0; i < this._commandCollection.Length;
i++)
{
if ((this._commandCollection != null))
{
((System.Data.SqlClient.SqlCommand)(this._commandCollection)).CommandTimeout
= value;
}
}
}
}
}
}
My solution compiles without errors, but I do not how to call this
newly created property from the page, on which I have my
ObjectDataSource.
I would like to do sth like that (e.g. in the Page_Load event):
P_RWI_PAYMENTS_SEARCHTableAdapter.SelectCommandTimeout = 180
but this TableAdapter is not seen in IntelliSense.
Piotrek