title: I want my code to be like Moduler. Anybody can help? VB.NET
body: <pre><code>        Dim Connectionstring As String = "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Anbar;Integrated Security=True"
          Dim sqlcommand As New Data.SqlClient.SqlCommand
          Dim sqlconnection As New Data.SqlClient.SqlConnection
          Dim dataadapter As New Data.SqlClient.SqlDataAdapter(sqlcommand)
          sqlconnection.ConnectionString = Connectionstring
          sqlcommand.Connection = sqlconnection
          sqlcommand.CommandText = "insert into [dbo].[User] ([name],[lastname],[username],[password]) VALUES (@name,@lastname,@username,@password)"
          sqlcommand.Parameters.AddWithValue("@name", txtfristname.Text)
          sqlcommand.Parameters.AddWithValue("@lastname", txtlastname.Text)
          sqlcommand.Parameters.AddWithValue("@username", txtusernameregister.Text)
          sqlcommand.Parameters.AddWithValue("@password", txtpasswordregister.Text)
  
          sqlconnection.Open()
          sqlcommand.ExecuteNonQuery()
          sqlconnection.Close()
  </code></pre>
  
  <p>My Code Already Work But I Want Be Moduler ...can any body help??</p>