473,480 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to connect different database using vb.net 2005

7 New Member
i used this code (below) but it have error on this line "dAdapter2.Fill(dSet2, "BPC_EMPLOYEE")"

Expand|Select|Wrap|Line Numbers
  1. Dim ConnectionString As String = "Server=bpc-k2;Database=FIXED ASSET DISPOSAL;Integrated Security=SSPI"
  2.         Dim mySQLConn As New SqlConnection(ConnectionString)
  3.         mySQLConn.Open()
  4.  
  5. Dim strSQL2 As String = "SELECT b.name,b.email,b.empid,f.novell,f.empid FROM BPC_EMPLOYEE B,FXAD_VERIFIER F WHERE f.novell='" & loguserid & "' AND f.empid=b.empid"
  6.         Dim dAdapter2 As New SqlDataAdapter(strSQL2, mySQLConn2)
  7.         Dim dAdapter3 As New SqlDataAdapter(strSQL2, mySQLConn)
  8.         Dim dSet2 As New DataSet
  9.         Dim dSet3 As New DataSet
  10.         dAdapter2.Fill(dSet2, "BPC_EMPLOYEE")
  11.         dAdapter3.Fill(dSet3, "FXAD_VERIFIER")
  12.         Dim dtable2 As DataTable = dSet2.Tables("BPC_EMPLOYEE")
  13.         Dim dtable3 As DataTable = dSet3.Tables("FXAD_VERIFIER")
  14.         Dim dRow1 As DataRow
  15.         Dim bname, bemail As String
  16.         For Each dRow1 In dtable2.Rows
  17.             bname = dRow1.Item("NAME")
  18.             bemail = dRow1.Item("EMAIL") 'email of logged user
  19.         Next
Mar 21 '10 #1
2 1797
tlhintoq
3,525 Recognized Expert Specialist
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.

Until someone with more experience can offer more targeted advice I can point you toward these:

Database How-to parts 1 and 2
Database tutorial Part 1
Database tutorial Part 2
Mar 21 '10 #2
CroCrew
564 Recognized Expert Contributor
What is the error that your getting?
Mar 22 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4070
by: Wade | last post by:
Is it possible to connect to a SQL 2005 Express db using Visual Basic 2005 Express? I cannot get past the connection.open statement without the error "...Version=2.0.0.0;...
14
6992
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
0
2592
by: Larry Rebich | last post by:
I am trying to use the sample web template that is distributed with Visual Studio 2005 called 'Personal Web Site Starter Kit'. After running for awhile it fails with the following message: ...
4
3927
by: Bob | last post by:
Hello folks, I am tring to create a connection to a SQL Server 2005 database but cannot. I get an error messahe that SQL Server does not exist or access denied I have tried Windows...
6
5080
by: mplpost | last post by:
Our web application requires that when a new Organization is created,a separate Database is to be created for the corresponding organization, so that each organization remains a separate entity...
1
6877
by: Ben Hanson | last post by:
I've scoured Google searching for an answer that seems like it should be easy but apparently isn't...when I open SSMS to connect to a SQL 2005 database and choose Windows authentication, it greys...
5
2505
by: Alan Silver | last post by:
Hello, Server configuration: Windows 2003 Server SP2 SQL Server 2000 SP4 ..NET v2.0.50727 just built up a new server using the same configuration as my current one. I even used the same CDs...
1
10691
by: ZZ_Scarab | last post by:
Hi, <I posted this on the microsoft.public.dotnet.framework.aspnet.security newsgroup but before I got a reply this newsgroup has become unavailable!! So I'm posting it here again. Sorry for the...
1
2489
by: Abdulla Herzallah | last post by:
Hi everyone I don't know if I am posting this to the right newsgroup but it is the closest I found, in case you think you can advice me to another newsgroup please feel free to do so. I am so...
8
2814
by: BD | last post by:
I am developing C# win form app to work with remote database on SQL Server 2005. Problem scenario is as follows: 1. a form is open that has downloaded dataset to local cache 2. computer is...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6886
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.