Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. con.ConnectionString = "Server = ;Database=;User Id=;Password = ;"
  2.  
  3. conecta.Open()
  4. comando.Connection = con
  5. cmd = New SqlCommand("prdInserirRegistro", con)
  6. cmd.CommandType = CommandType.StoredProcedure
  7.  
  8. cmd.Parameters.Add(New SqlParameter("@dtLog", SqlDbType.DateTime, 30))
  9. cmd.Parameters.Add(New SqlParameter("@dsLog", SqlDbType.VarChar, 200))
  10.  
  11. 'recebe o parâmetro selecionado na combobox
  12. cmd.Parameters("@dtLog").Value = Now
  13. cmd.Parameters("@dsLog").Value = txtBoxLog.Text
  14.  
  15.  
  16. cmd.ExecuteNonQuery()
  17. Catch ex As Exception
  18. MsgBox("erro em: " & ex.Message)
  19. Finally
  20.  
  21. If Not con Is Nothing Then
  22. con.Close()
  23. con.Dispose()
  24. End If
  25. con = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement