Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Thursday, March 29, 2012

General Network Error on subscriber

I am trying to replicate over a dial-up connection a database between
a server running Sql Server 2000 on Windows 2000 server and two SQL
server 2000 personal edition on Windows XP pro.
For one site, the replication worked correclty. For the other one, the
replication process starts, but when trying to connect to the
subscriber (i.e Windows XP pro), after waiting 5 minutes the following
error message is displayed:
Merge Process could not retreive generation information at the
subscriber.
General Network error source <windows xp database> (data source) error
number 11.
Replication tries again automatically and same error is displayed.
All suggestions are welcome.
Best Regards
Patrick
Use the slow link profile for this problem subscribe. Right click on the
agent (expand replication monitor, replication agents, merge agents, locate
your agent), select agent profiles, select the slow link profile, accept
defaults and restart it.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Patrick" <pmenage@.intnet.mu> wrote in message
news:4b9f6ca1.0411250208.6f22429a@.posting.google.c om...
>I am trying to replicate over a dial-up connection a database between
> a server running Sql Server 2000 on Windows 2000 server and two SQL
> server 2000 personal edition on Windows XP pro.
> For one site, the replication worked correclty. For the other one, the
> replication process starts, but when trying to connect to the
> subscriber (i.e Windows XP pro), after waiting 5 minutes the following
> error message is displayed:
> Merge Process could not retreive generation information at the
> subscriber.
> General Network error source <windows xp database> (data source) error
> number 11.
> Replication tries again automatically and same error is displayed.
> All suggestions are welcome.
> Best Regards
> Patrick
|||I just found the solution. When I entered my user name in the dial-up
connection box I entered it with the remote machine name eg: PC1\User1.
But when I checked the user in the "add user to operating system" module
in Windows XP, the machine name was dropped, only the user name
appeared. So when connecting, I entered only the user name, and
everything worked fine.
Thank you for your support.
Best Regards
Patrick
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

General Network error even good connection and small amount of data

Hy everyone,

I have a problem at pulling data on PDA using Sql Mobile 5 from Sql Server 2000.

It work s for most tables, except for two . Every table of those two has about 1000 records and every record about 150 bytes, so all data is about 150 kbytes.

When I connect to the Sql Server 2000 through LAN, no problem. But when I connect through GPRS - VPN, the error occurs. But, the PDA- phone connection is via Bluetooth and at ping no TimeOut appears, the replies are about 600-700 ms. When connecting with a desktop computer through GPRS no such problem occurs.

So , I don't know what could be the cause: the connection or the Sql Mobile which doesn't retry enough in case of error to transfer all data .

A specialist from the GPRS provider told me to use 3G phone , but , because the GPRS phones have already been bought, this would be a too big investment. So, I don't think this is a good idea in this moment .

I found similar problem on the net and a solution was to use Pooling = False. But , in Sql Mobile there is no pulling parameter available when making the connection string .

Any help is very precious to me ,

Mihai .

Hi Mihai,

Seems like you are using a GPRS phone to act like a bluetooth modem for a PDA. This is a tested scenario, and would work :) A couple of issues i can imagine right-away:

1. From the ping round trip time of 600 ms, i guess the synchronization must be timing-out at the TCP/IP level. Below are some time-out properties (HTTP &TCP/IP) of the merge replication and RDA programming objects, which can be set to optimize synchronization over various network bandwidths.

(HTTP)

ConnectionRetryTimeout: Specifies the time, in seconds, to continue to retry sending requests after an established connection has failed.

(TCP/IP)

ConnectTimeout: Specifies the time, in milliseconds, to wait for a connection to the server.

ReceiveTimeout: Specifies the time, in milliseconds, to wait for the response to a server request.

SendTimeout: Specifies the time, in milliseconds, to wait to send a request to the server.

When data is synchronized over a cellular or mobile network, requests sent to the server, and responses from the server can time out. This occurs when a low-bandwidth connection requires too much time to transmit the data. In your case, you have an overhead of the bluetooth transport as well! These time-outs would cause synchronization to fail, which you can solve by specifying a longer time-out value. Try setting a huge value (60000 ms) in your code for the TCP/IP Connect and Send/Recieve Timeouts on the merge replication/RDA object. This mostly should solve your problem.

2. Bluetooth DUN Profile - I assume you are using the Dial-Up Networking profile for the phone to act as a GPRS modem. Are you sure there are no pairing issues? During our tests, we faced a lot of issues with the bluetooth pairing - especially between WM 5.0 PDA's and third party mobile devices.

Let me know if this works out!

Regards,

Sravanth Aluru

|||

When inserting the parameters you specify for the connection string I get an error that says "Unknown connection option ..." .

And for the SqlConnection object there are no properties like those. Only PacketSize, ConnectionTimeout .

I forgot to say previously that I put in connection string "Packet Size=512" and "ConnectionTimeout=90". I tried even with ConnectionTimeout=180. No change.

Do I miss anything, any assembly declaration ?

Could give me another advice ?

Mihai.

|||

The parameters are available in SQL Mobile 3.1 Beta which shipped with Visual Studio 2005 SP1 and onwards.

Sorry for missing this information out in my earlier response!

Can you specify which version you are on?

/Sravanth

|||

I have Sql Mobile 3.00. So , now I am downloading it . I'll reply as soon as I have news.

Thanks a lot,

Mihai.

|||

I can't get sql mobile 3.1

I just installed VS Professional, then SP1. Only Sql mobile 3.0. Anyway, in VS when I try to add reference to System.Data.Sqlclient it shows 3.0 version .

I tried to connect with SendTimeout parameter in the connection string . But I get error which says it is unknown parameter.

I even installed Sql everywhere because I saw it was 3.1 version. Nothing .

I also installed 3_SQL Server 2005 Mobile Edition Server Tools ...

I don't know what else to do.

Any suggestion ?

Thank you,

Mihai .

|||

Yes, I see. It's TCP/IP level ... sorry .

Of course I won't have those parameters in connection string. But how can I work at stream level and use the SQL commands to get data ? Everywhere in docs, when using TcpClient class, the stream is used for sending/receiving data .

But, how do I do to use these TCP/IP parameters if I work at IP level, with sql connection and then sql commands ?

Please give me some advices , I'm a rookie in working with these protocols.

Thanks a lot,

Mihai.

|||

This is a sample of how I get data:

SqlConnection s2000conn = new SqlConnection("Server=10.1.1.10 ; Connection Timeout=60 ; Packet Size = 512 ; UId=user;Pwd=pwd;Database=GestSC");

try

{

s2000conn.Open();

}

catch (SqlException eroare)

{

MessageBox.Show("Connection error", "Eroare Sql");

return;

}

SqlCommand sqlcoms = new SqlCommand();

sqlcoms.CommandText = "SELECT * FROM part ";

SqlDataAdapter da_part = new SqlDataAdapter(sqlcoms.CommandText, s2000conn);

DataSet ds_part = new DataSet();

DataTable dt_part = ds_part.Tables.Add("downpart");

da_part.Fill(ds_part, "downpart");

.....

Then I insert this data in Sql Mobile database .

But how would I use TcpClient ?

TcpClient tc = new TcpClient();

tc.SendTimeout = 90;

And then ?

Thank you ,

Mihai .

|||

Man ,

Is it that simple that it doesn't really worth the effort or you have no answer ?

Can you say smth ?

Thanks anyway,

Mihaila.

|||

Hy all,

I solved the problem by breaking the results into many smaller packets.

First I counted the total number of records and then Fill-ed the cursor with a for-end loop. Simple, but initially I wanted to work in the default mode, not to write code.

And it works.

Finally I heared from the GPRS provider that the GPRS allows small packets of data (maximum 2048 for Packet Size preffered) and the transport of data is not very reliable, so small amount of data should be transfered at one time.

Thank you anyway for all your replies,

Mihaila.

General Network error even good connection and small amount of data

Hy everyone,

I have a problem at pulling data on PDA using Sql Mobile 5 from Sql Server 2000.

It work s for most tables, except for two . Every table of those two has about 1000 records and every record about 150 bytes, so all data is about 150 kbytes.

When I connect to the Sql Server 2000 through LAN, no problem. But when I connect through GPRS - VPN, the error occurs. But, the PDA- phone connection is via Bluetooth and at ping no TimeOut appears, the replies are about 600-700 ms. When connecting with a desktop computer through GPRS no such problem occurs.

So , I don't know what could be the cause: the connection or the Sql Mobile which doesn't retry enough in case of error to transfer all data .

A specialist from the GPRS provider told me to use 3G phone , but , because the GPRS phones have already been bought, this would be a too big investment. So, I don't think this is a good idea in this moment .

I found similar problem on the net and a solution was to use Pooling = False. But , in Sql Mobile there is no pulling parameter available when making the connection string .

Any help is very precious to me ,

Mihai .

Hi Mihai,

Seems like you are using a GPRS phone to act like a bluetooth modem for a PDA. This is a tested scenario, and would work :) A couple of issues i can imagine right-away:

1. From the ping round trip time of 600 ms, i guess the synchronization must be timing-out at the TCP/IP level. Below are some time-out properties (HTTP &TCP/IP) of the merge replication and RDA programming objects, which can be set to optimize synchronization over various network bandwidths.

(HTTP)

ConnectionRetryTimeout: Specifies the time, in seconds, to continue to retry sending requests after an established connection has failed.

(TCP/IP)

ConnectTimeout: Specifies the time, in milliseconds, to wait for a connection to the server.

ReceiveTimeout: Specifies the time, in milliseconds, to wait for the response to a server request.

SendTimeout: Specifies the time, in milliseconds, to wait to send a request to the server.

When data is synchronized over a cellular or mobile network, requests sent to the server, and responses from the server can time out. This occurs when a low-bandwidth connection requires too much time to transmit the data. In your case, you have an overhead of the bluetooth transport as well! These time-outs would cause synchronization to fail, which you can solve by specifying a longer time-out value. Try setting a huge value (60000 ms) in your code for the TCP/IP Connect and Send/Recieve Timeouts on the merge replication/RDA object. This mostly should solve your problem.

2. Bluetooth DUN Profile - I assume you are using the Dial-Up Networking profile for the phone to act as a GPRS modem. Are you sure there are no pairing issues? During our tests, we faced a lot of issues with the bluetooth pairing - especially between WM 5.0 PDA's and third party mobile devices.

Let me know if this works out!

Regards,

Sravanth Aluru

|||

When inserting the parameters you specify for the connection string I get an error that says "Unknown connection option ..." .

And for the SqlConnection object there are no properties like those. Only PacketSize, ConnectionTimeout .

I forgot to say previously that I put in connection string "Packet Size=512" and "ConnectionTimeout=90". I tried even with ConnectionTimeout=180. No change.

Do I miss anything, any assembly declaration ?

Could give me another advice ?

Mihai.

|||

The parameters are available in SQL Mobile 3.1 Beta which shipped with Visual Studio 2005 SP1 and onwards.

Sorry for missing this information out in my earlier response!

Can you specify which version you are on?

/Sravanth

|||

I have Sql Mobile 3.00. So , now I am downloading it . I'll reply as soon as I have news.

Thanks a lot,

Mihai.

|||

I can't get sql mobile 3.1

I just installed VS Professional, then SP1. Only Sql mobile 3.0. Anyway, in VS when I try to add reference to System.Data.Sqlclient it shows 3.0 version .

I tried to connect with SendTimeout parameter in the connection string . But I get error which says it is unknown parameter.

I even installed Sql everywhere because I saw it was 3.1 version. Nothing .

I also installed 3_SQL Server 2005 Mobile Edition Server Tools ...

I don't know what else to do.

Any suggestion ?

Thank you,

Mihai .

|||

Yes, I see. It's TCP/IP level ... sorry .

Of course I won't have those parameters in connection string. But how can I work at stream level and use the SQL commands to get data ? Everywhere in docs, when using TcpClient class, the stream is used for sending/receiving data .

But, how do I do to use these TCP/IP parameters if I work at IP level, with sql connection and then sql commands ?

Please give me some advices , I'm a rookie in working with these protocols.

Thanks a lot,

Mihai.

|||

This is a sample of how I get data:

SqlConnection s2000conn = new SqlConnection("Server=10.1.1.10 ; Connection Timeout=60 ; Packet Size = 512 ; UId=user;Pwd=pwd;Database=GestSC");

try

{

s2000conn.Open();

}

catch (SqlException eroare)

{

MessageBox.Show("Connection error", "Eroare Sql");

return;

}

SqlCommand sqlcoms = new SqlCommand();

sqlcoms.CommandText = "SELECT * FROM part ";

SqlDataAdapter da_part = new SqlDataAdapter(sqlcoms.CommandText, s2000conn);

DataSet ds_part = new DataSet();

DataTable dt_part = ds_part.Tables.Add("downpart");

da_part.Fill(ds_part, "downpart");

.....

Then I insert this data in Sql Mobile database .

But how would I use TcpClient ?

TcpClient tc = new TcpClient();

tc.SendTimeout = 90;

And then ?

Thank you ,

Mihai .

|||

Man ,

Is it that simple that it doesn't really worth the effort or you have no answer ?

Can you say smth ?

Thanks anyway,

Mihaila.

|||

Hy all,

I solved the problem by breaking the results into many smaller packets.

First I counted the total number of records and then Fill-ed the cursor with a for-end loop. Simple, but initially I wanted to work in the default mode, not to write code.

And it works.

Finally I heared from the GPRS provider that the GPRS allows small packets of data (maximum 2048 for Packet Size preffered) and the transport of data is not very reliable, so small amount of data should be transfered at one time.

Thank you anyway for all your replies,

Mihaila.

sql

Tuesday, March 27, 2012

General network error

I am running on Win2k, SQL Server 2000 (sp3), MDAC 2.8 and using a
TCP/IP client connection.

I get this error when attempting to restore a database.

[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead
(WrapperRead()).
[Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error.
Check your network documentation.

Does anybody know how to resolve this issue?

ThanksHi

Have you checked that there is not a network problem? Try a different port,
check no errors in the event log ...

John

"CD" <carl.davis@.gmail.com> wrote in message
news:fceeddde.0408270623.5c9c9fec@.posting.google.c om...
> I am running on Win2k, SQL Server 2000 (sp3), MDAC 2.8 and using a
> TCP/IP client connection.
> I get this error when attempting to restore a database.
>
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead
> (WrapperRead()).
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error.
> Check your network documentation.
>
> Does anybody know how to resolve this issue?
> Thanks|||CD (carl.davis@.gmail.com) writes:
> I am running on Win2k, SQL Server 2000 (sp3), MDAC 2.8 and using a
> TCP/IP client connection.
> I get this error when attempting to restore a database.
>
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead
> (WrapperRead()).
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error.
> Check your network documentation.
>
> Does anybody know how to resolve this issue?

That's bad. It appears that your SQL Server thread experiences an
access violation, or other serious execution error and termintates
your thread. This could be because the backup is corrupt or because
of a hardware problem on the disk you are trying to restore to.

If you look in the SQL Server error, you should find a stack dump, but
it is unlikely that this will give you any useful information.

If you are in serious need of that data, you should open a case with
Microsoft.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"CD" <carl.davis@.gmail.com> wrote in message
news:fceeddde.0408270623.5c9c9fec@.posting.google.c om...
> I am running on Win2k, SQL Server 2000 (sp3), MDAC 2.8 and using a
> TCP/IP client connection.
> I get this error when attempting to restore a database.
>
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead
> (WrapperRead()).
> [Microsoft][ODBC SQL Server Driver][DBNETLIB]General network error.
> Check your network documentation.
>
> Does anybody know how to resolve this issue?
> Thanks

Check out
http://support.microsoft.com/defaul...2&Product=sql2k
as it relates specifically to your issue.

Kevin

General connection to SQL Server... done... grids and data retrival ...ugghhh

Help!!! please!!!... I'm pulling my hair off... Having an external hosting for sql server is terrible for .net. Too many restrictions and they are not willing to help at all... I cannot connect directly, I have to do everything using strings. Honestly and it's a shame to admit it I never learned how to connect using strings, only using the wizard (upsizing DBs from Access to SQL Server)finally, after a month of trying I was able to connect to the database using a string like this:
Dim CS As String
Dim db_name, db_username, db_userpassword As String
Dim db_server As String

db_server = "blah,blah,secureserver.net" /yes, with them >:(
db_name = "DB##"
db_username = "***"
db_userpassword = "***"


Me.SqlConnection1.ConnectionString = "SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

I am probably not using it right but it's working to capture info using stored procedures but I've been trying to get my datagrids to connect and they are impossible... Any ideas? what would be the coding part of the datagrid/dataset/etc... connection? That probably means that I can't use the property builder or the dataset generator, right? Any ideas ? Thanks

(using 1.1 Framework)

I hope you are not doing this in every page? Tomorrow if you need to change hosting companies you dont want to go through all the pain you are now going through again, do you? You might want to put the connection string in web.config file and use the connection string all over your app. So even if you need to point the server to a different machine, its just one line you need to change and your app can remain as is.

Regarding code snippets for datagrid/dataset check out articles at 4guysfromrolla.com. They have an extensive series of articles on datagrids. Besides you can always google for specific issues.

sql

General Advise on application

Hi ,
One small doubt want to ask .
When the application is not cluster specific & when its used on cluster
(limited to connection only) .
What the applicaion has todo to get the cluster awareness thereby it won't
loose the connectivity .
Thanks
Ajay RengunthwarHi
If a client application uses the services of a clustered SQL Server, the
application needs to be able to re-connect ot the SQL Server virtual server
name after the failover occurs, and re-submit any batches that had not
completed at the time of the failover.
Very short running transaction are even more critical in this scenario.
Running a batch that takes 30 minutes is not ideal.
Regards
Mike
"Aju" wrote:
> Hi ,
> One small doubt want to ask .
> When the application is not cluster specific & when its used on cluster
> (limited to connection only) .
> What the applicaion has todo to get the cluster awareness thereby it won't
> loose the connectivity .
> Thanks
> Ajay Rengunthwar
>
>|||You need the application to trap and handle its errors. For a Clustered SQL
Server installation, if a Failover occurs, there will be a momentary,
perhaps up to 5 or 10 minutes, as the service on one machine is brought down
and then the services on the other node are brought online. It is automated
and responsive, but there is still an outage.
Your application should get connectivity errors. Look for them, pause, and
try to reconnect. Have some logic in there to attempt a few times before
giving up.
Sincerely,
Anthony Thomas
"Aju" <ajuonline@.yahoo.com> wrote in message
news:OkCDPMq3EHA.4092@.TK2MSFTNGP14.phx.gbl...
Hi ,
One small doubt want to ask .
When the application is not cluster specific & when its used on cluster
(limited to connection only) .
What the applicaion has todo to get the cluster awareness thereby it won't
loose the connectivity .
Thanks
Ajay Rengunthwarsql

General Advise on application

Hi ,
One small doubt want to ask .
When the application is not cluster specific & when its used on cluster
(limited to connection only) .
What the applicaion has todo to get the cluster awareness thereby it won't
loose the connectivity .
Thanks
Ajay Rengunthwar
Hi
If a client application uses the services of a clustered SQL Server, the
application needs to be able to re-connect ot the SQL Server virtual server
name after the failover occurs, and re-submit any batches that had not
completed at the time of the failover.
Very short running transaction are even more critical in this scenario.
Running a batch that takes 30 minutes is not ideal.
Regards
Mike
"Aju" wrote:

> Hi ,
> One small doubt want to ask .
> When the application is not cluster specific & when its used on cluster
> (limited to connection only) .
> What the applicaion has todo to get the cluster awareness thereby it won't
> loose the connectivity .
> Thanks
> Ajay Rengunthwar
>
>
|||You need the application to trap and handle its errors. For a Clustered SQL
Server installation, if a Failover occurs, there will be a momentary,
perhaps up to 5 or 10 minutes, as the service on one machine is brought down
and then the services on the other node are brought online. It is automated
and responsive, but there is still an outage.
Your application should get connectivity errors. Look for them, pause, and
try to reconnect. Have some logic in there to attempt a few times before
giving up.
Sincerely,
Anthony Thomas

"Aju" <ajuonline@.yahoo.com> wrote in message
news:OkCDPMq3EHA.4092@.TK2MSFTNGP14.phx.gbl...
Hi ,
One small doubt want to ask .
When the application is not cluster specific & when its used on cluster
(limited to connection only) .
What the applicaion has todo to get the cluster awareness thereby it won't
loose the connectivity .
Thanks
Ajay Rengunthwar

Monday, March 26, 2012

gateway dropping SQL Connection

Hi guys,
I need some serious help from any of you geniuses here. I have a
problem with an Access 2000 adp connection. I have users on that site
going through a gateway to communicate to our server and we are having
major connection problems. It seems that something on the network or
the gateway keeps dropping our connection to the sql 2000 server.
Is there any setting or even anything on the gateway hardware itself
that would be responsible for doing this? I would need to be able to
instruct the Network tech on what to do since I don't have any admin
rights to do it myself and the network tech might not know what to do.
Thanks in advance
bump
Marvinq wrote:
> Hi guys,
> I need some serious help from any of you geniuses here. I have a
> problem with an Access 2000 adp connection. I have users on that site
> going through a gateway to communicate to our server and we are having
> major connection problems. It seems that something on the network or
> the gateway keeps dropping our connection to the sql 2000 server.
> Is there any setting or even anything on the gateway hardware itself
> that would be responsible for doing this? I would need to be able to
> instruct the Network tech on what to do since I don't have any admin
> rights to do it myself and the network tech might not know what to do.
> Thanks in advance
sql

gateway dropping SQL Connection

Hi guys,
I need some serious help from any of you geniuses here. I have a
problem with an Access 2000 adp connection. I have users on that site
going through a gateway to communicate to our server and we are having
major connection problems. It seems that something on the network or
the gateway keeps dropping our connection to the sql 2000 server.
Is there any setting or even anything on the gateway hardware itself
that would be responsible for doing this? I would need to be able to
instruct the Network tech on what to do since I don't have any admin
rights to do it myself and the network tech might not know what to do.
Thanks in advancebump
Marvinq wrote:
> Hi guys,
> I need some serious help from any of you geniuses here. I have a
> problem with an Access 2000 adp connection. I have users on that site
> going through a gateway to communicate to our server and we are having
> major connection problems. It seems that something on the network or
> the gateway keeps dropping our connection to the sql 2000 server.
> Is there any setting or even anything on the gateway hardware itself
> that would be responsible for doing this? I would need to be able to
> instruct the Network tech on what to do since I don't have any admin
> rights to do it myself and the network tech might not know what to do.
> Thanks in advance

gateway dropping SQL Connection

Hi guys,
I need some serious help from any of you geniuses here. I have a
problem with an Access 2000 adp connection. I have users on that site
going through a gateway to communicate to our server and we are having
major connection problems. It seems that something on the network or
the gateway keeps dropping our connection to the sql 2000 server.
Is there any setting or even anything on the gateway hardware itself
that would be responsible for doing this? I would need to be able to
instruct the Network tech on what to do since I don't have any admin
rights to do it myself and the network tech might not know what to do.
Thanks in advancebump
Marvinq wrote:
> Hi guys,
> I need some serious help from any of you geniuses here. I have a
> problem with an Access 2000 adp connection. I have users on that site
> going through a gateway to communicate to our server and we are having
> major connection problems. It seems that something on the network or
> the gateway keeps dropping our connection to the sql 2000 server.
> Is there any setting or even anything on the gateway hardware itself
> that would be responsible for doing this? I would need to be able to
> instruct the Network tech on what to do since I don't have any admin
> rights to do it myself and the network tech might not know what to do.
> Thanks in advance

Monday, March 19, 2012

Fundamental help required with SQL connection

I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
server.

When I create and instance of the server, it has a the format
machinename/instancename

This is fine for the developement machine but how does my code connect to
the server when it is on another machine ? When an instance of MSDE is run
on the target, it will produce...
anotherPCname/instancename

Thanks for any helpThe 'Data Source' keyword in the connection string specifies the SQL Server
instance you want to connect to. A best practice is to store the connection
string externally (e.g. config file) rather than hard-code it in your app so
that you can connect to different servers without changing code. Connection
string examples:

Local default instance:
Data Source=ThisServer;Initial Catalog=MyDatabase;Integrated Security=SSPI

Local named instance:
Data Source=ThisServer\ThisInstance;Initial Catalog=MyDatabase;Integrated
Security=SSPI

Remote default instance:
Data Source=OtherServer;Initial Catalog=MyDatabase;Integrated Security=SSPI

Remote named instance:
Data Source=OtherServer\OtherInstance;Initial Catalog=MyDatabase;Integrated
Security=SSPI

--
Hope this helps.

Dan Guzman
SQL Server MVP

"David" <david@.orbitcoms.com> wrote in message
news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> server.
> When I create and instance of the server, it has a the format
> machinename/instancename
> This is fine for the developement machine but how does my code connect to
> the server when it is on another machine ? When an instance of MSDE is run
> on the target, it will produce...
> anotherPCname/instancename
> Thanks for any help
>|||Dan,

Thanks for the reply.

So, I just need to create a text file with the connection string with say

the local machine ID and database name. The application loads this at boot

and

connects to the named server.

When I deploy the application, I have the client alter the text file by

finding

the machine name and modifying the text to suit ??

I suppose I could use a Try Catch and have try with the local settings and

if it fails

it loads the file in the catch sub (or maybe the string is stored in

registry).

One thing I am also unable to find out is. How does MSDE know where the file

is located on the third party machine ? Should the Initial Catalog =

Path+dasename ?

Thanks

"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:FayEc.70$oD3.17@.newsread1.news.pas.earthlink. net...
> The 'Data Source' keyword in the connection string specifies the SQL
Server
> instance you want to connect to. A best practice is to store the
connection
> string externally (e.g. config file) rather than hard-code it in your app
so
> that you can connect to different servers without changing code.
Connection
> string examples:
> Local default instance:
> Data Source=ThisServer;Initial Catalog=MyDatabase;Integrated Security=SSPI
> Local named instance:
> Data Source=ThisServer\ThisInstance;Initial Catalog=MyDatabase;Integrated
> Security=SSPI
> Remote default instance:
> Data Source=OtherServer;Initial Catalog=MyDatabase;Integrated
Security=SSPI
> Remote named instance:
> Data Source=OtherServer\OtherInstance;Initial
Catalog=MyDatabase;Integrated
> Security=SSPI
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "David" <david@.orbitcoms.com> wrote in message
> news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> > I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> > server.
> > When I create and instance of the server, it has a the format
> > machinename/instancename
> > This is fine for the developement machine but how does my code connect
to
> > the server when it is on another machine ? When an instance of MSDE is
run
> > on the target, it will produce...
> > anotherPCname/instancename
> > Thanks for any help|||Hi

To connect to a different instance/server that is running your database then
the connection string will need to be changed. Quite often this sort of
thing is held in the registry and you configure it on installation.
Alternatively you may want to provide a small application to configure the
settings.

http://www.microsoft.com/sql/msde/t...integration.asp

John

"David" <david@.orbitcoms.com> wrote in message
news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> server.
> When I create and instance of the server, it has a the format
> machinename/instancename
> This is fine for the developement machine but how does my code connect to
> the server when it is on another machine ? When an instance of MSDE is run
> on the target, it will produce...
> anotherPCname/instancename
> Thanks for any help
>|||Thanks again for the replies.

I have tried a hard-coded option of connection and it worked.

ie.

TRY
sqlconnectionstring = ...... originalmachinename......password=..."
CATCH
sqlconnectionstring = ...... newmachinename......password=..."
END TRY

I tried to hook this into a config file but I had trouble(I used the wizard
in VB.NET to make the connection string and edited it but the area the code
was placed did not seem to like me playing with the code adding file open
command etc.

I will try by completely coding the connection in the main form load
routine.
Like this

TRY
Load my original instance for development and test
CATCH
read registry and see if validconnect string exists
if so then try to connect else
prompt user for PC name
save name to registry
try to connect
FINALLY
give up
END TRY

would this approach seem reasonable ?

"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:_FyEc.6675$%N6.73110644@.news-text.cableinet.net...
> Hi
> To connect to a different instance/server that is running your database
then
> the connection string will need to be changed. Quite often this sort of
> thing is held in the registry and you configure it on installation.
> Alternatively you may want to provide a small application to configure the
> settings.
> http://www.microsoft.com/sql/msde/t...integration.asp
> John
> "David" <david@.orbitcoms.com> wrote in message
> news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> > I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> > server.
> > When I create and instance of the server, it has a the format
> > machinename/instancename
> > This is fine for the developement machine but how does my code connect
to
> > the server when it is on another machine ? When an instance of MSDE is
run
> > on the target, it will produce...
> > anotherPCname/instancename
> > Thanks for any help|||Hi

This may help:
http://support.microsoft.com/defaul...kb;en-us;309485
http://support.microsoft.com/defaul...kb;EN-US;283245

John

"David" <david@.orbitcoms.com> wrote in message
news:qazEc.71562$sj4.10264@.news-server.bigpond.net.au...
> Thanks again for the replies.
> I have tried a hard-coded option of connection and it worked.
> ie.
> TRY
> sqlconnectionstring = ......
originalmachinename......password=..."
> CATCH
> sqlconnectionstring = ...... newmachinename......password=..."
> END TRY
> I tried to hook this into a config file but I had trouble(I used the
wizard
> in VB.NET to make the connection string and edited it but the area the
code
> was placed did not seem to like me playing with the code adding file open
> command etc.
> I will try by completely coding the connection in the main form load
> routine.
> Like this
> TRY
> Load my original instance for development and test
> CATCH
> read registry and see if validconnect string exists
> if so then try to connect else
> prompt user for PC name
> save name to registry
> try to connect
> FINALLY
> give up
> END TRY
> would this approach seem reasonable ?
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:_FyEc.6675$%N6.73110644@.news-text.cableinet.net...
> > Hi
> > To connect to a different instance/server that is running your database
> then
> > the connection string will need to be changed. Quite often this sort of
> > thing is held in the registry and you configure it on installation.
> > Alternatively you may want to provide a small application to configure
the
> > settings.
> > http://www.microsoft.com/sql/msde/t...integration.asp
> > John
> > "David" <david@.orbitcoms.com> wrote in message
> > news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> > > I am writing SQL data apps using VB.NET 2003, MSDE is being used as
the
> > > server.
> > > > When I create and instance of the server, it has a the format
> > > machinename/instancename
> > > > This is fine for the developement machine but how does my code connect
> to
> > > the server when it is on another machine ? When an instance of MSDE is
> run
> > > on the target, it will produce...
> > > anotherPCname/instancename
> > > > Thanks for any help
> > > >|||I finally have the problem figured out. I needed to ATTACH the database to
sql server (MSDE2000) using the osql utility.

Now, would someone be able to explain how I can automate the attachment at
the customer end.
Preferably, I would like my VN.NET application install to copy the
unattached database files and attach them to the MSDE server.

Thanks

"David" <david@.orbitcoms.com> wrote in message
news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> server.
> When I create and instance of the server, it has a the format
> machinename/instancename
> This is fine for the developement machine but how does my code connect to
> the server when it is on another machine ? When an instance of MSDE is run
> on the target, it will produce...
> anotherPCname/instancename
> Thanks for any help
>|||Hi
I am totally new to the VB.net, only learn this about two weeks. I
used codes from MS to create a file upload class then add function to
store the uploaded filename to a table in SQL server. However I kept
getting the error message about "cannot connect to database" No matter
what format I used. I have tried at least two dozen connection stringe
formats either in Sqlconnection or OleDBConnection. Here is the basic
formats that I used:
strCon = "Data Source =localhost;Password=;User ID=sa;Initial
Catalog=Northwind" for SqlConnection
strCon = "Provider=SQLOLEDB.1;User ID=sa;Password=;Persist Security
Info=True;Initial Catalog=Northwind;Data Source=FAL-L6388" for
OleDbConnection.
I use SQL 7, which was installed by default, i,e only have user ID =
sa, no password, use the default Northwind database. That's all. My
Server is local named FAL-L688.
I have replaced the Data Source with Server= but still give me same
error. I even used an udl to create the OleDB coonnection and put
into my string, still NO. I have exhauseted all alternatives. Does
anyone have clue? Is anyway to debug the trasaction? so i can find out
what went wrong?|||Here is my codes:
Imports System.Data.OleDb
Imports System.Configuration
...
Dim oCon As New OleDbConnection
Dim oCmd As New OleDbCommand
oCon = New OleDbConnection(ConfigurationSettings.AppSettings( "strCon"))
oCon.Open()

oCmd.CommandType = CommandType.StoredProcedure
oCmd.CommandText = "set_order_attachments"
oCmd.Parameters.Add("@.cart_id", OleDbType.VarChar, 15, cart_id)
oCmd.Parameters.Add("@.attachment", OleDbType.VarChar, 255,
strFilenamesCollection)
oCmd.Connection = oCon
Try
oCon.Open()
oCmd.ExecuteNonQuery()
...
And I have fololowing setting in the Web.config file under the
<configuration>
<appSettings>
<add key="strCon"
value="Provider=SQLOLEDB.1;User ID=sa;Password=;Initial
Catalog=Northwind;Server=(local);" />
</appSettings>
Also tried to use "Data Source=.." and enter my local machine name
there.
None of them work , came back the same "Non DB connection"

C Chang|||There was a duplicated "oCon.Open()" in my codes, but removal it does
not help. However, I tried to use the OracleCommand with the SQL query
script directly and IT WORKS!. Does anyone know why it does not work
with the Oracle procedure. I hate to change all my procedure calls to
in-line scripts. Besides if there is a complicated procedure then the
query becomes a problem.|||(chi-soon_x_chang@.raytheon.com) writes:
> There was a duplicated "oCon.Open()" in my codes, but removal it does
> not help. However, I tried to use the OracleCommand with the SQL query
> script directly and IT WORKS!. Does anyone know why it does not work
> with the Oracle procedure. I hate to change all my procedure calls to
> in-line scripts. Besides if there is a complicated procedure then the
> query becomes a problem.

I'm getting confused, are you connecting to SQL Server or to Oracle?

To go back to your original code, the error message seems like it
would from your own code. That is, I cannot really recall any error
that says "Cannot connect to database". It would help, if you could
get hold of the actual message from the client library. To that end,
it would help if you posted more parts of the code, and also if you
found out on exactly which statement, things go wrong.

Stupid check: you have SQL Server running, haven't you?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Hi

In addition to Erlands comments, you may want to move the try block earlier
to catch the connection error. Also check out
http://www.connectionstrings.com/ for the connection string, I think you
should be using Data Source instead of Server. Try using the IP address
instead of the name if necessary.

John

<chi-soon_x_chang@.raytheon.com> wrote in message
news:1103838243.185277.162240@.z14g2000cwz.googlegr oups.com...
> There was a duplicated "oCon.Open()" in my codes, but removal it does
> not help. However, I tried to use the OracleCommand with the SQL query
> script directly and IT WORKS!. Does anyone know why it does not work
> with the Oracle procedure. I hate to change all my procedure calls to
> in-line scripts. Besides if there is a complicated procedure then the
> query becomes a problem.