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 6117631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:20:35+00:00 2026-05-23T15:20:35+00:00

I have a very difficult task, that I think exceeds my level of knowledge

  • 0

I have a very difficult task, that I think exceeds my level of knowledge of databases. I am only learning it for a week, so I require help.

I currently have an old database that has tables for requests and customers. This information is currently displayed in ASP.NET

What I was required to do, was to connect a new database for users into this system, while keeping the tables for the requests in the old database. Thus it is using 2 databases. I have set it up so, when a user creates a new request, in the request tables it saves it with his userID from the new database, but when the table is being displayed, it uses this new userID to find the user information from the old customers table. Thus I ended up with this:

Sub BindDataGrid()
    cmdoledb = New SqlCommand("SELECT r.customerid, r.RequestID, R.RequestDate, R.RequestDescription, a.AssignedTo, r.Urgency, r.ExCompletionDate from tbl_requests r, tbl_assignedto a where r.statusid = 1 and r.assignedtoid= a.assignedtoid ", objConn)
    objConn.Open()

    Dim rdr As SqlDataReader
    Dim myItem As ListItem = New ListItem()
    rdr = cmdoledb.ExecuteReader(0)

    While rdr.Read()
        myItem = New ListItem()
        myItem.Value = rdr.GetInt32(0)
        cmddb = New SqlCommand("SELECT SESFirstName + ' ' + SESLastName As fullname from SESLogin where SESLoginID = @customerID", objConnect)
        cmddb.Parameters.AddWithValue("@customerID", myItem.Value)
        objConnect.Open()
        Dim anotherAdapter As New SqlDataAdapter(cmddb)
        Dim dss As New DataSet
        anotherAdapter.Fill(dss)
        dgrdUsers.DataSource = dss
        objConnect.Close()
    End While

    Dim myAdapter As New SqlDataAdapter(cmdoledb)
    Dim ds As New DataSet
    myAdapter.Fill(ds)
    dgrdUsers.DataSource = ds
    dgrdUsers.DataBind()
    objConn.Close()
End Sub

Currently it displays nothing, and gives out an error for myItem.Value = rdr.GetInt32(0) being a Null. I went through it step by step and it loads customerids normaly into the myItem.Value, but when they run out, it is supposed to exit, but keeps going, thus giving an error.

This code is very silly i know, but with my knowledge, this is what I was able to come up with. Thus I require your help and advice, to fix this issue I am having.

  • 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-23T15:20:35+00:00Added an answer on May 23, 2026 at 3:20 pm

    Well, the first thing I would do is combine your two databases into one (preferably using views as replacements for you existing tables), if indeed you are using two dbs (it’s not clear from your code sample whether you really are using two dbs or simply additional tables).

    You are executing you primary query twice, once for a data reader and once for a dataadapter.fill. You should do the fill first and then iterate over the resulting rows. The code sample is using a list item in oreder to contain a single integer, unless you are not showing all of your code, you should just use an integer variable.

    I don’t know if it fits in with what you are doing or not, but you only need one dataset with two tables to contain the data you are retrieving.

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

Sidebar

Related Questions

I have very little programming knowledge; only a fair bit in Visual Basic. How
i have very simple problem. I need to create model, that represent element of
I have very long integer sequences that look like this (arbitrary length!): 0000000001110002220033333 Now
So this one is a very difficult one I think, so I'll try to
I have a very difficult problem I'm trying to solve: Let's say I have
I need your support because I have got very difficult problem. I would like
Making .htaccess (mod_rewrite) work has been very difficult I already have this script for
I have been having a very difficult time editing my .htaccess file to do
I have looked for a lot of tutorials online and it is very difficult
I have got experience working in Spring framework, but i find it very difficult

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.