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

  • Home
  • SEARCH
  • 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 6346351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:00:00+00:00 2026-05-24T21:00:00+00:00

I am trying to connection to MS SQL SERVER 2008 database (students), i want

  • 0

I am trying to connection to MS SQL SERVER 2008 database (students), i want to make sure:

1) If connection string that i made is OK

Dim connectionString As New SqlConnection("server=X86ONX64; database=students; Integrated Security=True")

2) How can i check if dataset is producing any results?

Code:

Public Class Form1

'Connection String + DataAdaptor + DataSet
'Declared Outside Any Subroutines/Functions

Dim connectionString As New SqlConnection("server=X86ONX64; database=students; Integrated Security=True")
Dim dataAdaptor As New SqlDataAdapter()
Dim objdataSet As New DataSet()


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    dataAdaptor.SelectCommand = New SqlCommand()
    dataAdaptor.SelectCommand.Connection = connectionString
    dataAdaptor.SelectCommand.CommandText = "select * from basic_info;"
    dataAdaptor.SelectCommand.CommandType = CommandType.Text

    connectionString.Open()

    dataAdaptor.Fill(objdataSet, "StudentInfo")

    connectionString.Close()

    grd.AutoGenerateColumns = True
    grd.DataSource = objdataSet
    grd.DataMember = "basic_info"




    dataAdaptor = Nothing
    connectionString = Nothing


End Sub
  • 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-05-24T21:00:01+00:00Added an answer on May 24, 2026 at 9:00 pm

    About your first question, If connection string that i made is OK

    If you did not get any exceptions, you’ve successfully made the connection to your database.

    About your second question.

    There are two things you can do.

    1. Debug the wrong way. (It works though)

      MsgBox(objdataSet.Tables[0].Rows.Count);

    2. Learn and debug the correct way.

      Read these articles

      Debugging Basics
      Visual Studio Debugging
      Debugging Basics: Breakpoints

    Anyway, learn how to use the debugger properly, put a break point, analyse the objdataSet object in a watch window and see if any results are present.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a connection to a SQL Server Express DB on localhost,
I'm trying to test the connection of a GoDaddy SQL Server database. I'm getting
I have an Access 2003 database that connects to a SQL Server 2008 box
I am trying to configure my connection using SQL Server Express 2008. Can anyone
I'm trying to connect to SQL Server 2008 express database from Visual Studio 2010
I'm trying to commit a transaction to my Sql Server 2008 database - firstly
I am trying to connect to a SQL Server 2008 database through a C#
I'm having trouble seeing tables from one particular SQL Server 2008 database while trying
I have an ASP application trying to access a database in SQL Server 2008.
I'm using SQL Server 2008. I'm trying to find out which connection within to

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.