473,695 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fill dataset/grid with multiple queries from multiple servers

I understand that I can fill a datagrid with multiple queries, but I cannot
figure out how to fill a dataset with the same query but run against
multiple SQL servers, the query , table structure and username, password etc
will be exactly the same for each server, the only thing that will change is
the server name. Idealy I would like to get the server names from a seperate
dataset so there could be any number of servers, allthough in practice it
would be unlikely that there would be more than 3 servers.

Any Ideas, I'm a bit lost.
Cheers
Dave.
Nov 20 '05 #1
4 3749
wouldnt u just have to pass it to a different connection then before u
execute the dataadapter ?
or just use the same connection itself but the data source portion of the
connection string would be referencing the server name as a variable that is
passed as a parameter ..

"Dave Edwards" <no**@none.co m> wrote in message
news:7p******** ******@newsfe2-gui.ntli.net...
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against
multiple SQL servers, the query , table structure and username, password etc will be exactly the same for each server, the only thing that will change is the server name. Idealy I would like to get the server names from a seperate dataset so there could be any number of servers, allthough in practice it
would be unlikely that there would be more than 3 servers.

Any Ideas, I'm a bit lost.
Cheers
Dave.

---
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.723 / Virus Database: 479 - Release Date: 19/07/2004
Nov 20 '05 #2
Well I managed to pul something together myself in the end that works quite
well

Dim I As Integer
Dim dsXMLData As New DataSet
Dim DS As New DataSet

dsXMLData.ReadX ml("serverlist. xml")

For I = 0 To dsXMLData.Table s(0).Rows.Count - 1
Dim connect As New SqlConnection(" Integrated
Security=SSPI;d atabase=databas e;server=" &
dsXMLData.Table s(0).Rows(I).It em(0))
connect.Open()
Dim command As String = "SELECT * form table"
Dim adaptor As SqlDataAdapter = New SqlDataAdapter( command, connect)
adaptor.Fill(DS )
DataGrid1.DataS ource = DS
Next I

The onlt problem I have is that I now need to navigate through the datagrid
to get to the data. When the app first opens I get a + sign on the datagrid,
clicking that I get the word table and clicking that I get to the data, any
ideas how to get straight to the data?

Cheers
Charlie.

"Mike Smith" <te**@test.co m> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
wouldnt u just have to pass it to a different connection then before u
execute the dataadapter ?
or just use the same connection itself but the data source portion of the
connection string would be referencing the server name as a variable that is passed as a parameter ..

"Dave Edwards" <no**@none.co m> wrote in message
news:7p******** ******@newsfe2-gui.ntli.net...
I understand that I can fill a datagrid with multiple queries, but I cannot
figure out how to fill a dataset with the same query but run against
multiple SQL servers, the query , table structure and username, password

etc
will be exactly the same for each server, the only thing that will change is
the server name. Idealy I would like to get the server names from a

seperate
dataset so there could be any number of servers, allthough in practice

it would be unlikely that there would be more than 3 servers.

Any Ideas, I'm a bit lost.
Cheers
Dave.

---
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.723 / Virus Database: 479 - Release Date: 19/07/2004

Nov 20 '05 #3
yup the + comes on when u dont specify the table.. its sorta like a cool
featue i guess.. hahaha.. for asp.net u get the first table immediately
cause they cant render those fancy stuff.. anyway.......

u got 2 ways..

datagrid1.datas ource=ds.tables (0)
or
datagrid1.datas ource=ds
datagrid1.datam ember="TableNam e"
--
Regards,
Mike
http://bikesh.europe.webmatrixhosting.net
http://www.planetsourcecode.com (search keyword: phoetus)

"Dave Edwards" <no**@none.co m> wrote in message
news:hU******** ****@newsfe2-gui.ntli.net...
Well I managed to pul something together myself in the end that works quite well

Dim I As Integer
Dim dsXMLData As New DataSet
Dim DS As New DataSet

dsXMLData.ReadX ml("serverlist. xml")

For I = 0 To dsXMLData.Table s(0).Rows.Count - 1
Dim connect As New SqlConnection(" Integrated
Security=SSPI;d atabase=databas e;server=" &
dsXMLData.Table s(0).Rows(I).It em(0))
connect.Open()
Dim command As String = "SELECT * form table"
Dim adaptor As SqlDataAdapter = New SqlDataAdapter( command, connect)
adaptor.Fill(DS )
DataGrid1.DataS ource = DS
Next I

The onlt problem I have is that I now need to navigate through the datagrid to get to the data. When the app first opens I get a + sign on the datagrid, clicking that I get the word table and clicking that I get to the data, any ideas how to get straight to the data?

Cheers
Charlie.

"Mike Smith" <te**@test.co m> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
wouldnt u just have to pass it to a different connection then before u
execute the dataadapter ?
or just use the same connection itself but the data source portion of the
connection string would be referencing the server name as a variable that
is
passed as a parameter ..

"Dave Edwards" <no**@none.co m> wrote in message
news:7p******** ******@newsfe2-gui.ntli.net...
I understand that I can fill a datagrid with multiple queries, but I cannot
figure out how to fill a dataset with the same query but run against
multiple SQL servers, the query , table structure and username,

password etc
will be exactly the same for each server, the only thing that will change
is
the server name. Idealy I would like to get the server names from a

seperate
dataset so there could be any number of servers, allthough in practice

it would be unlikely that there would be more than 3 servers.

Any Ideas, I'm a bit lost.
Cheers
Dave.

---
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.723 / Virus Database: 479 - Release Date: 19/07/2004


yup the + comes on when u dont specify the table.. its sorta like a cool
featue i guess.. hahaha.. for asp.net u get the first table immediately
cause they cant render those fancy stuff.. anyway.......

u got 2 ways..

datagrid1.datas ource=ds.tables (0)
or
datagrid1.datas ource=ds
datagrid1.datam ember="TableNam e"
--
Regards,
Mike
http://bikesh.europe.webmatrixhosting.net
http://www.planetsourcecode.com (search keyword: phoetus)

"Dave Edwards" <no**@none.co m> wrote in message
news:hU******** ****@newsfe2-gui.ntli.net... Well I managed to pul something together myself in the end that works quite well

Dim I As Integer
Dim dsXMLData As New DataSet
Dim DS As New DataSet

dsXMLData.ReadX ml("serverlist. xml")

For I = 0 To dsXMLData.Table s(0).Rows.Count - 1
Dim connect As New SqlConnection(" Integrated
Security=SSPI;d atabase=databas e;server=" &
dsXMLData.Table s(0).Rows(I).It em(0))
connect.Open()
Dim command As String = "SELECT * form table"
Dim adaptor As SqlDataAdapter = New SqlDataAdapter( command, connect)
adaptor.Fill(DS )
DataGrid1.DataS ource = DS
Next I

The onlt problem I have is that I now need to navigate through the datagrid to get to the data. When the app first opens I get a + sign on the datagrid, clicking that I get the word table and clicking that I get to the data, any ideas how to get straight to the data?

Cheers
Charlie.

"Mike Smith" <te**@test.co m> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
wouldnt u just have to pass it to a different connection then before u
execute the dataadapter ?
or just use the same connection itself but the data source portion of the connection string would be referencing the server name as a variable that
is
passed as a parameter ..

"Dave Edwards" <no**@none.co m> wrote in message
news:7p******** ******@newsfe2-gui.ntli.net...
I understand that I can fill a datagrid with multiple queries, but I

cannot
figure out how to fill a dataset with the same query but run against
multiple SQL servers, the query , table structure and username,

password etc
will be exactly the same for each server, the only thing that will

change
is
the server name. Idealy I would like to get the server names from a

seperate
dataset so there could be any number of servers, allthough in practice

it would be unlikely that there would be more than 3 servers.

Any Ideas, I'm a bit lost.
Cheers
Dave.

---
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.723 / Virus Database: 479 - Release Date: 19/07/2004


Nov 20 '05 #4
Thanks Mike, that does the trick, i like this vb.net stuff. I'm learning
fast and getting things done.
"Mike Smith" <te**@test.co m> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
yup the + comes on when u dont specify the table.. its sorta like a cool
featue i guess.. hahaha.. for asp.net u get the first table immediately
cause they cant render those fancy stuff.. anyway.......

u got 2 ways..

datagrid1.datas ource=ds.tables (0)
or
datagrid1.datas ource=ds
datagrid1.datam ember="TableNam e"
--
Regards,
Mike
http://bikesh.europe.webmatrixhosting.net
http://www.planetsourcecode.com (search keyword: phoetus)

"Dave Edwards" <no**@none.co m> wrote in message
news:hU******** ****@newsfe2-gui.ntli.net...
Well I managed to pul something together myself in the end that works

quite
well

Dim I As Integer
Dim dsXMLData As New DataSet
Dim DS As New DataSet

dsXMLData.ReadX ml("serverlist. xml")

For I = 0 To dsXMLData.Table s(0).Rows.Count - 1
Dim connect As New SqlConnection(" Integrated
Security=SSPI;d atabase=databas e;server=" &
dsXMLData.Table s(0).Rows(I).It em(0))
connect.Open()
Dim command As String = "SELECT * form table"
Dim adaptor As SqlDataAdapter = New SqlDataAdapter( command, connect)
adaptor.Fill(DS )
DataGrid1.DataS ource = DS
Next I

The onlt problem I have is that I now need to navigate through the

datagrid
to get to the data. When the app first opens I get a + sign on the

datagrid,
clicking that I get the word table and clicking that I get to the data,

any
ideas how to get straight to the data?

Cheers
Charlie.

"Mike Smith" <te**@test.co m> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
wouldnt u just have to pass it to a different connection then before u
execute the dataadapter ?
or just use the same connection itself but the data source portion of the connection string would be referencing the server name as a variable that
is
passed as a parameter ..

"Dave Edwards" <no**@none.co m> wrote in message
news:7p******** ******@newsfe2-gui.ntli.net...
> I understand that I can fill a datagrid with multiple queries, but I
cannot
> figure out how to fill a dataset with the same query but run against
> multiple SQL servers, the query , table structure and username, password etc
> will be exactly the same for each server, the only thing that will

change
is
> the server name. Idealy I would like to get the server names from a
seperate
> dataset so there could be any number of servers, allthough in practice it
> would be unlikely that there would be more than 3 servers.
>
> Any Ideas, I'm a bit lost.
> Cheers
> Dave.
>
>
---
Outgoing mail is certified Virus Free. (well i'd like to think it
is.. ) Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.723 / Virus Database: 479 - Release Date: 19/07/2004


yup the + comes on when u dont specify the table.. its sorta like a cool
featue i guess.. hahaha.. for asp.net u get the first table immediately
cause they cant render those fancy stuff.. anyway.......

u got 2 ways..

datagrid1.datas ource=ds.tables (0)
or
datagrid1.datas ource=ds
datagrid1.datam ember="TableNam e"
--
Regards,
Mike
http://bikesh.europe.webmatrixhosting.net
http://www.planetsourcecode.com (search keyword: phoetus)

"Dave Edwards" <no**@none.co m> wrote in message
news:hU******** ****@newsfe2-gui.ntli.net...
Well I managed to pul something together myself in the end that works

quite
well

Dim I As Integer
Dim dsXMLData As New DataSet
Dim DS As New DataSet

dsXMLData.ReadX ml("serverlist. xml")

For I = 0 To dsXMLData.Table s(0).Rows.Count - 1
Dim connect As New SqlConnection(" Integrated
Security=SSPI;d atabase=databas e;server=" &
dsXMLData.Table s(0).Rows(I).It em(0))
connect.Open()
Dim command As String = "SELECT * form table"
Dim adaptor As SqlDataAdapter = New SqlDataAdapter( command, connect)
adaptor.Fill(DS )
DataGrid1.DataS ource = DS
Next I

The onlt problem I have is that I now need to navigate through the

datagrid
to get to the data. When the app first opens I get a + sign on the

datagrid,
clicking that I get the word table and clicking that I get to the data,

any
ideas how to get straight to the data?

Cheers
Charlie.

"Mike Smith" <te**@test.co m> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
wouldnt u just have to pass it to a different connection then before u
execute the dataadapter ?
or just use the same connection itself but the data source portion of the connection string would be referencing the server name as a variable that
is
passed as a parameter ..

"Dave Edwards" <no**@none.co m> wrote in message
news:7p******** ******@newsfe2-gui.ntli.net...
> I understand that I can fill a datagrid with multiple queries, but I
cannot
> figure out how to fill a dataset with the same query but run against
> multiple SQL servers, the query , table structure and username,

password etc
> will be exactly the same for each server, the only thing that will

change
is
> the server name. Idealy I would like to get the server names from a
seperate
> dataset so there could be any number of servers, allthough in practice it
> would be unlikely that there would be more than 3 servers.
>
> Any Ideas, I'm a bit lost.
> Cheers
> Dave.
>
>
---
Outgoing mail is certified Virus Free. (well i'd like to think it

is.. ) Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.723 / Virus Database: 479 - Release Date: 19/07/2004



Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1770
by: wackyphill | last post by:
I have a long running query. I want the results in a DataGrid. I'd like the grid and form to be responsive and fill up w/ rows as the result set is read into a dataset that is the datasource of the grid. Possible? If so, how should the thread handle updating the grid's datasource and have the grid reflect the changes w/o waiting till the thread finishes? Any example would be greatly appreciated. Thanks.
1
3180
by: Ersin Gençtürk | last post by:
hi , I have 2 tables , tUser and tUserRole and I have a query like : select * from tUser inner join tUserRole on tUserRole.UserId=tUser.UserId where tUser.UserId=1 this will return a user with associated roles. Also I have a typed dataset with two tables inside : tUser and tUserRole
2
6077
by: Stanav | last post by:
Hello all, I'm developing a web application using VB.Net 2003 and Framework 1.1. This application queries an AS/400 database. I'm using the IBM OleDb provider that came with IBM Client Access for Windows (V5R3). Everything works fine on my development PC, but when I move the application to a Windows Server 2003, it crashes when trying to fill a dataset. I've double-checked that the Win 2k3 server does have Client Access installed, that it...
2
1312
by: Aaron Ackerman | last post by:
I have been having just on going problems with my MS Datagrids. I have NO idea what I am doing wrong. What is esentially happening is that say I have three records in my Dataset. I click on the third row to populate the textboxes below the grid that correspond to the various columns in the grid. The textboxes fill. I edit the data in one of the textboxes. As I lose focus I update the dataset and refresh the grid. Well the third row...
5
2298
by: moondaddy | last post by:
I have a website where cataloge pages are populated by calling a stored procedure on sql server. I use the sql data adapter's fill method to call this stored procedure and fill the dataset. about 6 to 15 times a day the server hangs and times out when this fill method is called. The SP is simple and uses very little resources (as tested using client statistics in query analyzer). Here's data from my error log which includes the...
4
3283
by: jaYPee | last post by:
I have already done some code to fill the datagrid. my problem is that the fill method is too slow after executing my code. here is the scenario. i have a parent/child form. all is datagrid. one datagrid is a parent and the other is a child. now when i finish encoding data from the first datagrid (which is the parent) i have to click the check box button on that grid and fill the 2nd grid w/ the data from the other table base on the...
2
5222
by: MDB | last post by:
Hello All, I have a data grid that I fill using a dataset. The results of the query has around 15 columns and 500 rows (and growing). The reason I am using the datagrid is so the end users can auto sort and page so I would like to keep using the datagrid. My problem is that when I call DataAdapter.Fill, it takes a very long time and is even causing the web page to time out. Does anyone know why the fill is taking so long (15-20 sec)...
2
4202
by: slinky | last post by:
I'm getting a error when I open my . aspx in my browser... line 34: da.Fill(ds, "Assets") Here's the error and my entire code for this .aspx.vb is below that ... I need some clues as to what is causing the error... Thanks!!! Server Error in '/' Application. ---------------------------------------------------------------------------­----- Multiple-step OLE DB operation generated errors. Check each OLE DB
3
7398
by: ASPnewb1 | last post by:
I am currently filling a dataTable then adding this table to a dataset, setting the dataset to the Gridview's datasource. If I set the Gridview to generate columns automatically it will fill the grid just fine, but I can't get the automated column (column index 1) to be set to readonly. (Column 0 is actually an automated column of edit buttons) here's my code: DataSet ds = new DataSet(); DataTable dt = new DataTable();...
0
8617
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9112
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8822
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5827
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4332
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4570
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2994
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 we have to send another system
3
1970
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.