Example : How to Concatenate/add multiple fields of same table as one.
 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
     (Write complete database connectivity code here first)

      Dim a, b, c As String
      cn.Open()
      cm.CommandText = "select * from userreg where name='" + CmbPName.Text + "'"
      rdr = cm.ExecuteReader
      While (rdr.Read())
           TxtAlias.Text = (rdr("alias").ToString)
           a = (rdr("adr").ToString)
           b = (rdr("dist").ToString)
           c = (rdr("state").ToString)
           TxtAddr.Text = a + "," + b + "," + c
      End While
      cn.Close()
  End Sub

Loading

Categories: VB .Net Codes

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.