Q: System.Web.Services.Protocols.SoapException This error is generated in a ratio of 5:1.  4 times it will work without error, but the next time it runs it will return the error "Object reference not set to an instance of an object" for the same query string.
My system uses a web service (SVC) to connect to a MySql database for all of its CRUD operations. The Error is listed below:

System.Web.Services.Protocols.SoapException: DELETE FROM
  customer_number WHERE cus_id =4 Object reference not set to an
  instance of an object. at
  System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
  message, WebResponse response, Stream responseStream, Boolean
  asyncCall)    at
  System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
  methodName, Object[] parameters) at 
  POS.ThePOSServerService.PosMain.ExecuteQueryBool(String strQuery,
  String Company, String User, String Pass) in Reference.vb:line 266

While the code that generates error is as follows with line numbers:

    Try
    261  Dim ConnectionString As String = _ 
           ConfigurationManager.ConnectionStrings(Company).ConnectionString
    262  'Dim sCommand As StringBuilder = New 262 - StringBuilder(strQuery)
    263  Using mConnection As MySqlConnection = New MySqlConnection(ConnectionString)
    264      mConnection.Open()
    265      Using myCmd As MySqlCommand = New MySqlCommand(strQuery, mConnection)
    266          myCmd.CommandType = CommandType.Text
    267          Result = myCmd.ExecuteNonQuery() > 0
    268      End Using
    269  End Using
    Catch ex As Exception
        Throw New ApplicationException(ex.ToString)
    End Try

I just want to get Result to be True or False to return as a value.

A: It is my fault. never checked that the connection string was correctly coming into the function. once I corrected that (giving the correct connection string) everything went as I was expecting. Thanks to all anyway.
