Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8609335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:51:44+00:00 2026-06-12T03:51:44+00:00

I am new in Vb.NET and I have a code here which I got

  • 0

I am new in Vb.NET and I have a code here which I got from example, which select one table. What I want is I want to select another tABLe.. I just want to select another table other than users.. since I have a another form which binds/call another table.

How will I do it?

Dim connection As MySql.Data.MySqlClient.MySqlConnection
    Dim adapter As MySql.Data.MySqlClient.MySqlDataAdapter
    Dim commandBldr As MySql.Data.MySqlClient.MySqlCommandBuilder
    Dim command As MySql.Data.MySqlClient.MySqlCommand
    Dim dataSet As System.Data.DataSet
    Dim bindingSource1 As BindingSource

    Private Sub btConnect_Click(sender As System.Object, e As System.EventArgs) Handles btConnect.Click
        connection = New MySql.Data.MySqlClient.MySqlConnection
        connection.ConnectionString = "user id=" & tbUserName.Text + "; password=" & tbPassword.Text & "; server=" & tbServer.Text & "; database=" & tbDatabase.Text & "; pooling=false;"

        Try
            connection.Open()
            adapter = New MySql.Data.MySqlClient.MySqlDataAdapter
            commandBldr = New MySql.Data.MySqlClient.MySqlCommandBuilder
            command = New MySql.Data.MySqlClient.MySqlCommand
            dataSet = New System.Data.DataSet
            bindingSource1 = New BindingSource

            commandBldr.DataAdapter = adapter
            command.CommandText = "SELECT userID,pin, print1, print2 from users"
            command.Connection = connection
            adapter.SelectCommand = command
            adapter.Fill(dataSet)
            bindingSource1.DataSource = dataSet.Tables(0)
            dgvUsers.DataSource = bindingSource1

        Catch ex As Exception

        End Try

I got it by doing this…

dataSet = New DataSet
adapter.SelectCommand.CommandText = "select * from dtr"
adapter.Fill(dataSet)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:51:45+00:00Added an answer on June 12, 2026 at 3:51 am

    You should be able to change the command text of your example query to match what you want to pull back. For example:

    command.CommandText = "SELECT col1, col2 from newTable"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code for sending email to clients. System.Net.Mail.SmtpClient Client = new System.Net.Mail.SmtpClient(); MailMessage
I have some code that uses ODP.Net using (OracleConnection connection = new OracleConnection(connectionString)) {
i have the following code in an asp.net mvc view. <% = Html.DropDownList(Filter, new
Question ONE: I'm still pretty new to .net, but have used Visual Studio for
I have an asp.net website which contains a Thread that fetches some data from
I am new ASP.NET and I have never used a GridView or DataGrid, but
I have a new asp.net mvc project and i am trying to figure out
I am new to .Net. I have two objects, Customer and Country in my
I'm developing a new client-server app (.Net) and have up until now been using
I have created the following project structure for my new asp.net mvc project any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.