Dim strCnn As String = "Persist Security Info=False; Data Source=”Your Server name”;UID=”User Id”;PWD=”Your Password” ;Initial Catalog=Databse to connect;"
You can write connection string in Appconfig file or Classfile..
Insert query always good to have in stored procedure than in ur code..