How can I retrieve data from SQLServer with a specify network

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have to develop database client to retrieve data from SQLServer from a
machine that have 2 network adapters. How can I do this with .NET programming
to specify SQLServer on 1 network card. Once it can retrieve data from
SQLServer, the program have to send this data out to another network card.

I don't know where to post my question. So if I post to wrong group, please
suggest me and ignore my question.

Thanks in advance,
Thana N.
 
Hi Thana,

As I see it it is more of a OS configuration issue than programming issue.
Sorry, I can't help you more than this.
 
hi,
thanks for interest.but maybe my question was not clear enough.I am usingg
expression property to set a column to some calculated expressions , but in
this question what I want to ask was how shoul I retreive the joined tables
from the datasource (say sql) into a typed dataset in my application.

Miha Markic said:
Hi Thana,

As I see it it is more of a OS configuration issue than programming issue.
Sorry, I can't help you more than this.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Thana N. said:
I have to develop database client to retrieve data from SQLServer from a
machine that have 2 network adapters. How can I do this with .NET
programming
to specify SQLServer on 1 network card. Once it can retrieve data from
SQLServer, the program have to send this data out to another network card.

I don't know where to post my question. So if I post to wrong group,
please
suggest me and ignore my question.

Thanks in advance,
Thana N.
 
Hi Ersin,

Ersin Gençtürk said:
hi,
thanks for interest.but maybe my question was not clear enough.

You are also posting in a wrong thread :-)

I am usingg
expression property to set a column to some calculated expressions , but
in
this question what I want to ask was how shoul I retreive the joined
tables
from the datasource (say sql) into a typed dataset in my application.

You can't directly.
You could use DataReader and fill existing dataset manually or create
(another) a properly formated strong typed dataset and fill it using adapter
and your join statement.
 
The NIC is irrelevant. If the port is open (1344 or 1345) and not blocked by
a firewall, even if it is on a different network segment, whichever nick is
connected to the server will transmit/receive. In other words, beyond making
sure you have the port set, there's nothing more to do in terms of ".Net
programming".
 
The NIC is irrelevant. If the port is open (1344 or 1345) and not blocked
by a firewall, even if it is on a different network segment, whichever
nick is connected to the server will transmit/receive. In other words,
beyond making sure you have the port set, there's nothing more to do in
terms of ".Net programming".

Using the correct server name in the SqlConnection helps, too. :)

Dim cn1 As New SqlConnection(cnStringForServer1)
Dim cn2 As New SqlConnection(cnStringForServer2)

--
Peace & happy computing,

Mike Labosh, MCSD

"It's 4:30 am. Do you know where your stack pointer is?"
 
Sorry for my uncleared information. And yes there is no NIC issue if routing
is persisted. But my program have to run on an unstable network such as
dial-up network. So retrieving data from database from dial-up network is
unpredictable (sometimes routing table is wrong or lost). That's why I want
to know how to programming a program to route and/or check routing before
sending query to database.

Thanks for your advise.
Thana N.
 
Sorry for my uncleared information. And yes there is no NIC issue if
routing
is persisted. But my program have to run on an unstable network such as
dial-up network. So retrieving data from database from dial-up network is
unpredictable (sometimes routing table is wrong or lost). That's why I
want
to know how to programming a program to route and/or check routing before
sending query to database.

AHH! I get it now. In your connection string, the Data Source value is the
server you are going to connect to. This can be a hostname, such as
dbserver, a fully qualified DNS name, such as
dbserver.intranet.mycompany.com, or an IP address.

Typically, the IP address of the database server will not change, so you
don't need check the routing table. Just attempt a connection to the
database server. It will either be able to connect, or it won't:

Public Function CanIConnect() As Boolean

Dim cnstr As String = "my connection string"
Dim cn As New SqlConnection(cnstr)

Try
cn.Open()
Catch exc As Exception
Return False
End Try

cn.Close()
Return True

End Function
--
Peace & happy computing,

Mike Labosh, MCSD

"It's 4:30 am. Do you know where your stack pointer is?"
 
Back
Top