please can some one help me on how to connect different vb applications to a database server.like accessing data from one database by different applications...

Recommended Answers

All 4 Replies

Here is a good resource:
http://dev.mysql.com/tech-resources/articles/dotnet/

And here is some sample code for connecting to a MySql database.

Imports MySql.Data.MySqlClient

Module Module1

   Sub Main()
      Dim csb As New MySqlConnectionStringBuilder
      csb.UserID = "user"
      csb.Password = "pswd"
      csb.Server = "10.xx.xx.xx"
      csb.Database = "DB_NAME"

      Dim strSQL As String = "select COMMENTS from audit where ELEMENT='ZZZ630'"

      Dim conn As New MySqlConnection(csb.ToString())
      conn.Open()

      Dim cmd As New MySqlCommand(strSQL, conn)
      Dim rdr As MySqlDataReader = cmd.ExecuteReader()

      While rdr.Read()
         Console.WriteLine(rdr("COMMENTS").ToString().Trim())
      End While

      rdr.Close()
      conn.Close()
   End Sub

End Module

What database are you making use of?

check here for connection strings

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.