title: DELETE some records from a sql table
body: <p>I have created in my SQL Data Base a table with only two columns of type <code>UniqueIdentifier</code>.<br/>
  Now I need to delete certain records with the same UserId. And the code is: <br/></p>
  
  <pre><code>If aspProvider.SQLConn.State = ConnectionState.Closed Then aspProvider.SQLConn.Open()
       QueryString = "DELETE FROM aspnet_UsersInRoles WHERE UserId = @UserNewId"
       dbHandler.SQLComm = New SqlCommand(QueryString, aspProvider.SQLConn)
       srvHandler.SQLComm.CommandType = CommandType.TableDirect
       dbHandler.SQLComm.Parameters.Add("@UserNewId", SqlDbType.UniqueIdentifier).Value = UsrId
       srvHandler.SQLComm.ExecuteNonQuery()
  </code></pre>
  
  <p>When the pointer comes to the line <code>srvHandler.SQLComm.CommandType</code>, then it throws me an error:<br/></p>
  
  <p><code>Object reference not set to an instance of an object.</code></p>
  
  <p>The same happens when I delete this line, and when the pointer comes to the line: <br/></p>
  
  <p><code>srvHandler.SQLComm.ExecuteNonQuery()</code><br/></p>
  
  <p>The <code>UsrId</code>is the value of a GUID, and it's there when I debug the code<br/>
  Is someone to show me where I do something wrong? <br/>
  Thank you in advance.</p>