I have a stored procedure ln a sql 2k database. I call the s/p from a vb.net application it works well about half of hte time .... the other half it fails with the following error...
Timout Expired. The timout period elapsed prior to completion of the operation or the server is not responding.
I have been playing with the connection timeouts, but it does not seem to change anything.. as I am a newbie it could be that I am not using them correctly ... thanks for the help
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeleteOne.Click
Dim con As New SqlClient.SqlConnection
Dim da As New OleDb.OleDbDataAdapter
Dim ds As New DataSet
Dim sql As SqlClient.SqlCommand
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim Server As String
Dim Firstname As String = txtFirstName.Text
Dim Surname As String = txtSurName.Text
Dim UserInit As String = txtUserInit.Text
Dim Result As Integer = "0"
Dim ResultText As String = ""
Server = txtIPAddress.Text
con = New SqlClient.SqlConnection("Data Source =" & Server & ";initial catalog = Windman;User ID=user;Password=pass;Connect Timeout = 0")
sql = New SqlClient.SqlCommand("WMS_SP_UTL_DeleteUser", con)
.CommandType = CommandType.StoredProcedure
'//add some parameters
.Parameters.Add(New SqlClient.SqlParameter("@UserInitials", UserInit))
.Parameters.Add(New SqlClient.SqlParameter("@Result", 0))
.Parameters.Add(New SqlClient.SqlParameter("@Resulttext", ""))
MsgBox(UserInit & " deleted from " & Server)
Catch excA As SqlClient.SqlException