Hi Group,
As part of our efforts at best practices, we recently changed the default
port of 1433 for the first instance of SQL on our SQL server another port say
8888. There is a firewall between the SQL server and the clients. The
firewall rulebase was changed to allow traffic on port 8888 between the SQL
server and the clients.
However following the change the clients could not connect to the SQL
instance. I am not a database administrator, but my understanding of SQL is
that the clients would dynamically determine the changed port number using
the SQL browser (reporting) service and attempt a connection on the new port
8888.
Any ideas on what went wrong or is my understanding of how SQL connects
fundamentally wrong......any feedback is much apreciated.
Thanks
CMSQL Server uses SQL Server Resolution Protocol (SSRP) to resolve instance
name. In SQL Server 2000 SSRP is operated by SQL Server service (and I think
that if there is no instance working on port 1433 there is no automatic name
resolution). In SQL Server 2005 there is another service called SQL Server
Browser dedicated to respond to SSRP requests. It listens on UDP1434 (so you
must open this port on your firewall).
What you can try is to connect to SQL Server not by instance name but by
machine name and TCP port number: tcp:MACHINE_NAME,port. Example:
tcp:LONDON,8888
--
Regards
Pawel Potasinski
U¿ytkownik "CP" <CP@.discussions.microsoft.com> napisa³ w wiadomo¶ci
news:5A85887A-FE89-4245-837C-E01FDEF43BAB@.microsoft.com...
> Hi Group,
> As part of our efforts at best practices, we recently changed the default
> port of 1433 for the first instance of SQL on our SQL server another port
> say
> 8888. There is a firewall between the SQL server and the clients. The
> firewall rulebase was changed to allow traffic on port 8888 between the
> SQL
> server and the clients.
> However following the change the clients could not connect to the SQL
> instance. I am not a database administrator, but my understanding of SQL
> is
> that the clients would dynamically determine the changed port number using
> the SQL browser (reporting) service and attempt a connection on the new
> port
> 8888.
> Any ideas on what went wrong or is my understanding of how SQL connects
> fundamentally wrong......any feedback is much apreciated.
> Thanks
> CM
>|||Thanks for your response, Pawel.
We have 1434 opened on the firewall. Prior to this change we had (and still
do have) other instances of SQL on the same server. My understanding is that
the SQL Server Browser, was determinining the port numbers of these other
instances. So when the port no of default instance was changed, the
reporting service would determine the new port no as well.
This was tested in QA successfully albeit without a firewall in between. Do
you still think it would be worthwhile to connect using a machine name? We
are back to QA now, without a firewall in between.
Thanks again.
CM
"Pawel Potasinski" wrote:
> SQL Server uses SQL Server Resolution Protocol (SSRP) to resolve instance
> name. In SQL Server 2000 SSRP is operated by SQL Server service (and I think
> that if there is no instance working on port 1433 there is no automatic name
> resolution). In SQL Server 2005 there is another service called SQL Server
> Browser dedicated to respond to SSRP requests. It listens on UDP1434 (so you
> must open this port on your firewall).
> What you can try is to connect to SQL Server not by instance name but by
> machine name and TCP port number: tcp:MACHINE_NAME,port. Example:
> tcp:LONDON,8888
> --
> Regards
> Pawel Potasinski
>
> U¿ytkownik "CP" <CP@.discussions.microsoft.com> napisa³ w wiadomo¶ci
> news:5A85887A-FE89-4245-837C-E01FDEF43BAB@.microsoft.com...
> > Hi Group,
> >
> > As part of our efforts at best practices, we recently changed the default
> > port of 1433 for the first instance of SQL on our SQL server another port
> > say
> > 8888. There is a firewall between the SQL server and the clients. The
> > firewall rulebase was changed to allow traffic on port 8888 between the
> > SQL
> > server and the clients.
> >
> > However following the change the clients could not connect to the SQL
> > instance. I am not a database administrator, but my understanding of SQL
> > is
> > that the clients would dynamically determine the changed port number using
> > the SQL browser (reporting) service and attempt a connection on the new
> > port
> > 8888.
> >
> > Any ideas on what went wrong or is my understanding of how SQL connects
> > fundamentally wrong......any feedback is much apreciated.
> >
> > Thanks
> >
> > CM
> >
> >
>
>
Showing posts with label group. Show all posts
Showing posts with label group. Show all posts
Sunday, March 25, 2012
Thursday, March 22, 2012
Connecting to Reporting Services Server Fails
Originally posted on Reporting Services newsgroup - Then on Setup - no
answer there though, so I thought I'd try the Server group as well.
I've looked through documentation and can't find an answer there, and
nothing on the web that seemed to apply either. I'm hoping someone can
give me a push in the right direction.
I'm running SQL Server 2005 RTM on my laptop (Dell Latitude D810) but
cannot connect to Reporting Services Server. When I try to connect to
it using SQL Server Management Studio (using windows authentication) I
get the following Error message...
TITLE: Connect to Server
--
Cannot connect to {ServerName}.
ADDITIONAL INFORMATION:
The attempt to connect to the report server failed. Check your
connection information and that the report server is a compatible
version. (Microsoft.SqlServer.Management.UI.RSClient)
The request failed with HTTP status 404: Object Not Found.
(Microsoft.SqlServer.Management.UI.RSClient)
I have visual studio 2005 on the machine (which I installed after the
SQL Server install) and have .NET Framework version 2.0.50727.42.
The OS is Windows XP Professional.
Anyone know what I will need to do to connect to the server?Hi,
Did u configure the virtual directories for tht instance on which
reporting services are running if not configure it first.After
configuring it check it out wether it works or not and I am facing here
a diffrent problem with some unknown exceptions rising that is:
"The underlying connection was closed: An unexpected error occurred on
a receive. (Microsoft.SqlServer.Management.UI.RSClient)
Unable to read data from the transport connection: An established
connection was aborted by the software in your host machine. (System)
An established connection was aborted by the software in your host
machine (System)."
So, can u able to guide me through this problem,if it is it will be a
great help for ur friend from ur side.
Thanks and regards
- vishwas R
VISHWAS R
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message2000026.html
answer there though, so I thought I'd try the Server group as well.
I've looked through documentation and can't find an answer there, and
nothing on the web that seemed to apply either. I'm hoping someone can
give me a push in the right direction.
I'm running SQL Server 2005 RTM on my laptop (Dell Latitude D810) but
cannot connect to Reporting Services Server. When I try to connect to
it using SQL Server Management Studio (using windows authentication) I
get the following Error message...
TITLE: Connect to Server
--
Cannot connect to {ServerName}.
ADDITIONAL INFORMATION:
The attempt to connect to the report server failed. Check your
connection information and that the report server is a compatible
version. (Microsoft.SqlServer.Management.UI.RSClient)
The request failed with HTTP status 404: Object Not Found.
(Microsoft.SqlServer.Management.UI.RSClient)
I have visual studio 2005 on the machine (which I installed after the
SQL Server install) and have .NET Framework version 2.0.50727.42.
The OS is Windows XP Professional.
Anyone know what I will need to do to connect to the server?Hi,
Did u configure the virtual directories for tht instance on which
reporting services are running if not configure it first.After
configuring it check it out wether it works or not and I am facing here
a diffrent problem with some unknown exceptions rising that is:
"The underlying connection was closed: An unexpected error occurred on
a receive. (Microsoft.SqlServer.Management.UI.RSClient)
Unable to read data from the transport connection: An established
connection was aborted by the software in your host machine. (System)
An established connection was aborted by the software in your host
machine (System)."
So, can u able to guide me through this problem,if it is it will be a
great help for ur friend from ur side.
Thanks and regards
- vishwas R
VISHWAS R
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message2000026.html
Connecting to Reporting Services Server Fails
Originally posted on Reporting Services newsgroup - Then on Setup - no
answer there though, so I thought I'd try the Server group as well.
I've looked through documentation and can't find an answer there, and
nothing on the web that seemed to apply either. I'm hoping someone can
give me a push in the right direction.
I'm running SQL Server 2005 RTM on my laptop (Dell Latitude D810) but
cannot connect to Reporting Services Server. When I try to connect to
it using SQL Server Management Studio (using windows authentication) I
get the following Error message...
TITLE: Connect to Server
--
Cannot connect to {ServerName}.
--
ADDITIONAL INFORMATION:
The attempt to connect to the report server failed. Check your
connection information and that the report server is a compatible
version. (Microsoft.SqlServer.Management.UI.RSClient)
--
The request failed with HTTP status 404: Object Not Found.
(Microsoft.SqlServer.Management.UI.RSClient)
I have visual studio 2005 on the machine (which I installed after the
SQL Server install) and have .NET Framework version 2.0.50727.42.
The OS is windows XP Professional.
Anyone know what I will need to do to connect to the server?Hi,
Did u configure the virtual directories for tht instance on which
reporting services are running if not configure it first.After
configuring it check it out wether it works or not and I am facing here
a diffrent problem with some unknown exceptions rising that is:
"The underlying connection was closed: An unexpected error occurred on
a receive. (Microsoft.SqlServer.Management.UI.RSClient)
Unable to read data from the transport connection: An established
connection was aborted by the software in your host machine. (System)
An established connection was aborted by the software in your host
machine (System)."
So, can u able to guide me through this problem,if it is it will be a
great help for ur friend from ur side.
Thanks and regards
- vishwas R
VISHWAS R
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message2000026.html
answer there though, so I thought I'd try the Server group as well.
I've looked through documentation and can't find an answer there, and
nothing on the web that seemed to apply either. I'm hoping someone can
give me a push in the right direction.
I'm running SQL Server 2005 RTM on my laptop (Dell Latitude D810) but
cannot connect to Reporting Services Server. When I try to connect to
it using SQL Server Management Studio (using windows authentication) I
get the following Error message...
TITLE: Connect to Server
--
Cannot connect to {ServerName}.
--
ADDITIONAL INFORMATION:
The attempt to connect to the report server failed. Check your
connection information and that the report server is a compatible
version. (Microsoft.SqlServer.Management.UI.RSClient)
--
The request failed with HTTP status 404: Object Not Found.
(Microsoft.SqlServer.Management.UI.RSClient)
I have visual studio 2005 on the machine (which I installed after the
SQL Server install) and have .NET Framework version 2.0.50727.42.
The OS is windows XP Professional.
Anyone know what I will need to do to connect to the server?Hi,
Did u configure the virtual directories for tht instance on which
reporting services are running if not configure it first.After
configuring it check it out wether it works or not and I am facing here
a diffrent problem with some unknown exceptions rising that is:
"The underlying connection was closed: An unexpected error occurred on
a receive. (Microsoft.SqlServer.Management.UI.RSClient)
Unable to read data from the transport connection: An established
connection was aborted by the software in your host machine. (System)
An established connection was aborted by the software in your host
machine (System)."
So, can u able to guide me through this problem,if it is it will be a
great help for ur friend from ur side.
Thanks and regards
- vishwas R
VISHWAS R
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message2000026.html
Wednesday, March 7, 2012
Connecting to a 2005 database using 2000 EM
What are the steps to be able to add a 2005 server to a server group in the
2000 enterprise manager?
Thanks for any help,
Bob
You can't do that. You can, however, add a SQL 2000 database to SQL Server
Management Studio (the SQL 2005 replacement for EM.)
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Robert Dufour" <bdufour@.sgiims.com> wrote in message
news:%23grWQilGHHA.1912@.TK2MSFTNGP03.phx.gbl...
> What are the steps to be able to add a 2005 server to a server group in
> the 2000 enterprise manager?
> Thanks for any help,
> Bob
>
2000 enterprise manager?
Thanks for any help,
Bob
You can't do that. You can, however, add a SQL 2000 database to SQL Server
Management Studio (the SQL 2005 replacement for EM.)
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Robert Dufour" <bdufour@.sgiims.com> wrote in message
news:%23grWQilGHHA.1912@.TK2MSFTNGP03.phx.gbl...
> What are the steps to be able to add a 2005 server to a server group in
> the 2000 enterprise manager?
> Thanks for any help,
> Bob
>
Labels:
connecting,
database,
enterprise,
group,
managerthanks,
microsoft,
mysql,
oracle,
server,
sql,
steps,
the2000
Tuesday, February 14, 2012
Connect with TCP
Hello,
I hope I'm posting this in the right group.
I'm trying to connect to a network server running Sql Server 2005 Express
from vb 2005. I can connect to it when I use:
DATA SOURCE=<servername>\SQLEXPRESS;INITIAL CATALOG=<cat>;Integrated
Security=SSPI;
However I need to be able to connect to it from the internet using TCP. I
have openned port 1433 on my firewall. I have set the server to allow remote
connections and it still comes back with an error when i trie to connect. I
have even tried using this on my local network. Here is my connection string:
Data Source=192.168.0.xxx,1433;Network Library=DBMSSOCN;Initial
Catalog=<cat>;User ID=<user>;Password=<password>;
Any help would be appreciated.
Figured it out. Might help if I use the correct IP Address!
"Jason" wrote:
> Hello,
> I hope I'm posting this in the right group.
> I'm trying to connect to a network server running Sql Server 2005 Express
> from vb 2005. I can connect to it when I use:
> DATA SOURCE=<servername>\SQLEXPRESS;INITIAL CATALOG=<cat>;Integrated
> Security=SSPI;
> However I need to be able to connect to it from the internet using TCP. I
> have openned port 1433 on my firewall. I have set the server to allow remote
> connections and it still comes back with an error when i trie to connect. I
> have even tried using this on my local network. Here is my connection string:
> Data Source=192.168.0.xxx,1433;Network Library=DBMSSOCN;Initial
> Catalog=<cat>;User ID=<user>;Password=<password>;
> Any help would be appreciated.
>
I hope I'm posting this in the right group.
I'm trying to connect to a network server running Sql Server 2005 Express
from vb 2005. I can connect to it when I use:
DATA SOURCE=<servername>\SQLEXPRESS;INITIAL CATALOG=<cat>;Integrated
Security=SSPI;
However I need to be able to connect to it from the internet using TCP. I
have openned port 1433 on my firewall. I have set the server to allow remote
connections and it still comes back with an error when i trie to connect. I
have even tried using this on my local network. Here is my connection string:
Data Source=192.168.0.xxx,1433;Network Library=DBMSSOCN;Initial
Catalog=<cat>;User ID=<user>;Password=<password>;
Any help would be appreciated.
Figured it out. Might help if I use the correct IP Address!

"Jason" wrote:
> Hello,
> I hope I'm posting this in the right group.
> I'm trying to connect to a network server running Sql Server 2005 Express
> from vb 2005. I can connect to it when I use:
> DATA SOURCE=<servername>\SQLEXPRESS;INITIAL CATALOG=<cat>;Integrated
> Security=SSPI;
> However I need to be able to connect to it from the internet using TCP. I
> have openned port 1433 on my firewall. I have set the server to allow remote
> connections and it still comes back with an error when i trie to connect. I
> have even tried using this on my local network. Here is my connection string:
> Data Source=192.168.0.xxx,1433;Network Library=DBMSSOCN;Initial
> Catalog=<cat>;User ID=<user>;Password=<password>;
> Any help would be appreciated.
>
Connect with TCP
Hello,
I hope I'm posting this in the right group.
I'm trying to connect to a network server running Sql Server 2005 Express
from vb 2005. I can connect to it when I use:
DATA SOURCE=<servername>\SQLEXPRESS;INITIAL CATALOG=<cat>;Integrated
Security=SSPI;
However I need to be able to connect to it from the internet using TCP. I
have openned port 1433 on my firewall. I have set the server to allow remote
connections and it still comes back with an error when i trie to connect. I
have even tried using this on my local network. Here is my connection string
:
Data Source=192.168.0.xxx,1433;Network Library=DBMSSOCN;Initial
Catalog=<cat>;User ID=<user>;Password=<password>;
Any help would be appreciated.Figured it out. Might help if I use the correct IP Address!
"Jason" wrote:
> Hello,
> I hope I'm posting this in the right group.
> I'm trying to connect to a network server running Sql Server 2005 Express
> from vb 2005. I can connect to it when I use:
> DATA SOURCE=<servername>\SQLEXPRESS;INITIAL CATALOG=<cat>;Integrated
> Security=SSPI;
> However I need to be able to connect to it from the internet using TCP. I
> have openned port 1433 on my firewall. I have set the server to allow remo
te
> connections and it still comes back with an error when i trie to connect.
I
> have even tried using this on my local network. Here is my connection stri
ng:
> Data Source=192.168.0.xxx,1433;Network Library=DBMSSOCN;Initial
> Catalog=<cat>;User ID=<user>;Password=<password>;
> Any help would be appreciated.
>
I hope I'm posting this in the right group.
I'm trying to connect to a network server running Sql Server 2005 Express
from vb 2005. I can connect to it when I use:
DATA SOURCE=<servername>\SQLEXPRESS;INITIAL CATALOG=<cat>;Integrated
Security=SSPI;
However I need to be able to connect to it from the internet using TCP. I
have openned port 1433 on my firewall. I have set the server to allow remote
connections and it still comes back with an error when i trie to connect. I
have even tried using this on my local network. Here is my connection string
:
Data Source=192.168.0.xxx,1433;Network Library=DBMSSOCN;Initial
Catalog=<cat>;User ID=<user>;Password=<password>;
Any help would be appreciated.Figured it out. Might help if I use the correct IP Address!

"Jason" wrote:
> Hello,
> I hope I'm posting this in the right group.
> I'm trying to connect to a network server running Sql Server 2005 Express
> from vb 2005. I can connect to it when I use:
> DATA SOURCE=<servername>\SQLEXPRESS;INITIAL CATALOG=<cat>;Integrated
> Security=SSPI;
> However I need to be able to connect to it from the internet using TCP. I
> have openned port 1433 on my firewall. I have set the server to allow remo
te
> connections and it still comes back with an error when i trie to connect.
I
> have even tried using this on my local network. Here is my connection stri
ng:
> Data Source=192.168.0.xxx,1433;Network Library=DBMSSOCN;Initial
> Catalog=<cat>;User ID=<user>;Password=<password>;
> Any help would be appreciated.
>
Friday, February 10, 2012
Connect to SQL Server 2005 Using Visual Studio C++ 2005 ?
Hi All,
I hope I am in the correct group to ask such a question, anyway:
I am new to Visual Studio C++ (2005) and SQL Server 2005 as I have
recently moved across from using Borland C++, so VS has been pretty much
a steep learning curve for me.
I have created a database through SQL Server called dbTest.mdf, I did
this from SQLCMD (CREATE DATABASE dbTest).
I now want to connect to the database using Visual Studio C++ 2005 by
writing a simple app.
Obviously the code included below won't work - well I can't get it to
work, so please have a look at it and tell me where I'm going wrong....
Best Regards
Pete
#include "stdafx.h"
using namespace System;
using namespace System::Data;
using namespace System::Data::Sql;
using namespace System::Data::SqlClient;
int main(array<System::String ^> ^args)
{
SqlConnection conn;
conn = new SqlConnection("Data Source=PETER-VTR1000\SQLEXPRESS;Initial
Catalog=dbTest;Integrated Security=True");
return 0;
}
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
-->>>>>>http://www.NewsDemon.com<<<<<<--
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access"Pete Moscatt" <peter.moscatt@.gmail.com> wrote in message
news:448a5f1b$0$29247$b9f67a60@.news.newsdemon.com...
> Hi All,
> I hope I am in the correct group to ask such a question, anyway:
> I am new to Visual Studio C++ (2005) and SQL Server 2005 as I have
> recently moved across from using Borland C++, so VS has been pretty much a
> steep learning curve for me.
> I have created a database through SQL Server called dbTest.mdf, I did this
> from SQLCMD (CREATE DATABASE dbTest).
> I now want to connect to the database using Visual Studio C++ 2005 by
> writing a simple app.
> Obviously the code included below won't work - well I can't get it to
> work, so please have a look at it and tell me where I'm going wrong....
>
Sure. This is C++/CLI.
Your other option to access SqlServer form C++ is OleDB. But I like this
much better since you get access to the whole .NET framework, and you can
use garbage-collected types.
Also there are tons of examples of how to use SqlServer through .NET in C#.
Once you master the syntax differences between C# and C++/CLI you can
easilly use them.
Anyway here's your code rewritten a bit.
David
#include "stdafx.h"
using namespace System;
using namespace System::Data;
using namespace System::Data::Sql;
using namespace System::Data::SqlClient;
void Run()
{
/*
SqlConnection implements IDisposable and must be cleaned up after it's
used.
But declaring as a local variable intead of a reference using gcnew
the compiler
will insert the cleanup code at the end of this scope.
*/
SqlConnection conn("Data Source=(local);Initial Catalog=test;Integrated
Security=True");
conn.Open();
/*
SqlCommand doesn't really need cleanup, so we can create that using
gcnew and access
it through a handle.
*/
SqlCommand^ cmd = gcnew SqlCommand("select top 10 Name from
sys.objects",%conn);
/*
SqlDataReader also needs cleanup, but it is returned from the
SqlCommand as a handle
so we can't use automatic storage for it. So a try/finally block
guarantees cleanup.
*/
SqlDataReader^ rdr = cmd->ExecuteReader();
try
{
while (rdr->Read())
{
System::Console::WriteLine(rdr[0]);
}
}
finally
{
rdr->Close();
}
}
int main(array<System::String ^> ^args)
{
try
{
Run();
return 0;
}
catch (Exception^ ex)
{
Console::WriteLine(ex);
return 1;
}
}|||Xref: TK2MSFTNGP01.phx.gbl microsoft.public.sqlserver.programming:608275
David Browne wrote:
> "Pete Moscatt" <peter.moscatt@.gmail.com> wrote in message
> news:448a5f1b$0$29247$b9f67a60@.news.newsdemon.com...
> Sure. This is C++/CLI.
> Your other option to access SqlServer form C++ is OleDB. But I like this
> much better since you get access to the whole .NET framework, and you can
> use garbage-collected types.
> Also there are tons of examples of how to use SqlServer through .NET in C#
.
> Once you master the syntax differences between C# and C++/CLI you can
> easilly use them.
> Anyway here's your code rewritten a bit.
> David
>
> #include "stdafx.h"
> using namespace System;
> using namespace System::Data;
> using namespace System::Data::Sql;
> using namespace System::Data::SqlClient;
> void Run()
> {
> /*
> SqlConnection implements IDisposable and must be cleaned up after it
's
> used.
> But declaring as a local variable intead of a reference using gcnew
> the compiler
> will insert the cleanup code at the end of this scope.
> */
> SqlConnection conn("Data Source=(local);Initial Catalog=test;Integrate
d
> Security=True");
> conn.Open();
> /*
> SqlCommand doesn't really need cleanup, so we can create that using
> gcnew and access
> it through a handle.
> */
> SqlCommand^ cmd = gcnew SqlCommand("select top 10 Name from
> sys.objects",%conn);
> /*
> SqlDataReader also needs cleanup, but it is returned from the
> SqlCommand as a handle
> so we can't use automatic storage for it. So a try/finally block
> guarantees cleanup.
> */
> SqlDataReader^ rdr = cmd->ExecuteReader();
> try
> {
> while (rdr->Read())
> {
> System::Console::WriteLine(rdr[0]);
> }
> }
> finally
> {
> rdr->Close();
> }
> }
> int main(array<System::String ^> ^args)
> {
> try
> {
> Run();
> return 0;
> }
> catch (Exception^ ex)
> {
> Console::WriteLine(ex);
> return 1;
> }
> }
>
>
G'Dave,
Thanks for the code - at least it now compiles.
When I run the EXE I am now faced with connection errors so now assume
that I need to pay more attention on how I installed SQL Server.
So, back to the books to clear that up - I can use SQLCMD so I guess I
can't be too far away on getting it right.
Currently I have the server connecting with TCP (port 1403) and I see I
could also used:
Named Pipes
TCP
VIA
What is considered the better way to connect ?
I had a look at the configuration of the Server and found to be 'local
service'
Would I be better of using:
local system
or
network service
or
local service (current)
Cheers
Pete
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
-->>>>>>http://www.NewsDemon.com<<<<<<--
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access|||"Pete Moscatt" <peter.moscatt@.gmail.com> wrote in message
news:448b95c4$0$30209$b9f67a60@.news.newsdemon.com...
> David Browne wrote:
> G'Dave,
> Thanks for the code - at least it now compiles.
> When I run the EXE I am now faced with connection errors so now assume
> that I need to pay more attention on how I installed SQL Server.
> So, back to the books to clear that up - I can use SQLCMD so I guess I
> can't be too far away on getting it right.
> Currently I have the server connecting with TCP (port 1403) and I see I
> could also used:
>
You probably need an instance name in the "Data Source".
SqlConnection conn("Data Source=(local)\SQLExpress;Initial
Catalog=test;Integrated Security=True");
conn.Open();
And "Initial Catalog" is the database name.
I would generally use TCP/IP (remote) and Shared Memory (local).
> Named Pipes
> TCP
> VIA
> What is considered the better way to connect ?
> I had a look at the configuration of the Server and found to be 'local
> service'
>
As for what account you use to run SQL Server, it really depends on your
security setup. Usually either Local Service or Network Service is
appropriate. But sometimes you will want to use a Domain account.
David|||On Sun, 11 Jun 2006 11:10:50 -0500, "David Browne" <davidbaxterbrowne
no potted meat@.hotmail.com> wrote:
>"Pete Moscatt" <peter.moscatt@.gmail.com> wrote in message
>news:448b95c4$0$30209$b9f67a60@.news.newsdemon.com...
>
>You probably need an instance name in the "Data Source".
> SqlConnection conn("Data Source=(local)\SQLExpress;Initial
>Catalog=test;Integrated Security=True");
> conn.Open();
>And "Initial Catalog" is the database name.
>I would generally use TCP/IP (remote) and Shared Memory (local).
>
>
>As for what account you use to run SQL Server, it really depends on your
>security setup. Usually either Local Service or Network Service is
>appropriate. But sometimes you will want to use a Domain account.
>
>David
>
Thanks Dave, it all a good thing at the moment.
You have me enough info for me to let loose and work things out
myself.
Again, thanks for all the assistance you have given me on this issue.
Pete
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
-->>>>>>http://www.NewsDemon.com<<<<<<--
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
I hope I am in the correct group to ask such a question, anyway:
I am new to Visual Studio C++ (2005) and SQL Server 2005 as I have
recently moved across from using Borland C++, so VS has been pretty much
a steep learning curve for me.
I have created a database through SQL Server called dbTest.mdf, I did
this from SQLCMD (CREATE DATABASE dbTest).
I now want to connect to the database using Visual Studio C++ 2005 by
writing a simple app.
Obviously the code included below won't work - well I can't get it to
work, so please have a look at it and tell me where I'm going wrong....
Best Regards
Pete
#include "stdafx.h"
using namespace System;
using namespace System::Data;
using namespace System::Data::Sql;
using namespace System::Data::SqlClient;
int main(array<System::String ^> ^args)
{
SqlConnection conn;
conn = new SqlConnection("Data Source=PETER-VTR1000\SQLEXPRESS;Initial
Catalog=dbTest;Integrated Security=True");
return 0;
}
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
-->>>>>>http://www.NewsDemon.com<<<<<<--
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access"Pete Moscatt" <peter.moscatt@.gmail.com> wrote in message
news:448a5f1b$0$29247$b9f67a60@.news.newsdemon.com...
> Hi All,
> I hope I am in the correct group to ask such a question, anyway:
> I am new to Visual Studio C++ (2005) and SQL Server 2005 as I have
> recently moved across from using Borland C++, so VS has been pretty much a
> steep learning curve for me.
> I have created a database through SQL Server called dbTest.mdf, I did this
> from SQLCMD (CREATE DATABASE dbTest).
> I now want to connect to the database using Visual Studio C++ 2005 by
> writing a simple app.
> Obviously the code included below won't work - well I can't get it to
> work, so please have a look at it and tell me where I'm going wrong....
>
Sure. This is C++/CLI.
Your other option to access SqlServer form C++ is OleDB. But I like this
much better since you get access to the whole .NET framework, and you can
use garbage-collected types.
Also there are tons of examples of how to use SqlServer through .NET in C#.
Once you master the syntax differences between C# and C++/CLI you can
easilly use them.
Anyway here's your code rewritten a bit.
David
#include "stdafx.h"
using namespace System;
using namespace System::Data;
using namespace System::Data::Sql;
using namespace System::Data::SqlClient;
void Run()
{
/*
SqlConnection implements IDisposable and must be cleaned up after it's
used.
But declaring as a local variable intead of a reference using gcnew
the compiler
will insert the cleanup code at the end of this scope.
*/
SqlConnection conn("Data Source=(local);Initial Catalog=test;Integrated
Security=True");
conn.Open();
/*
SqlCommand doesn't really need cleanup, so we can create that using
gcnew and access
it through a handle.
*/
SqlCommand^ cmd = gcnew SqlCommand("select top 10 Name from
sys.objects",%conn);
/*
SqlDataReader also needs cleanup, but it is returned from the
SqlCommand as a handle
so we can't use automatic storage for it. So a try/finally block
guarantees cleanup.
*/
SqlDataReader^ rdr = cmd->ExecuteReader();
try
{
while (rdr->Read())
{
System::Console::WriteLine(rdr[0]);
}
}
finally
{
rdr->Close();
}
}
int main(array<System::String ^> ^args)
{
try
{
Run();
return 0;
}
catch (Exception^ ex)
{
Console::WriteLine(ex);
return 1;
}
}|||Xref: TK2MSFTNGP01.phx.gbl microsoft.public.sqlserver.programming:608275
David Browne wrote:
> "Pete Moscatt" <peter.moscatt@.gmail.com> wrote in message
> news:448a5f1b$0$29247$b9f67a60@.news.newsdemon.com...
> Sure. This is C++/CLI.
> Your other option to access SqlServer form C++ is OleDB. But I like this
> much better since you get access to the whole .NET framework, and you can
> use garbage-collected types.
> Also there are tons of examples of how to use SqlServer through .NET in C#
.
> Once you master the syntax differences between C# and C++/CLI you can
> easilly use them.
> Anyway here's your code rewritten a bit.
> David
>
> #include "stdafx.h"
> using namespace System;
> using namespace System::Data;
> using namespace System::Data::Sql;
> using namespace System::Data::SqlClient;
> void Run()
> {
> /*
> SqlConnection implements IDisposable and must be cleaned up after it
's
> used.
> But declaring as a local variable intead of a reference using gcnew
> the compiler
> will insert the cleanup code at the end of this scope.
> */
> SqlConnection conn("Data Source=(local);Initial Catalog=test;Integrate
d
> Security=True");
> conn.Open();
> /*
> SqlCommand doesn't really need cleanup, so we can create that using
> gcnew and access
> it through a handle.
> */
> SqlCommand^ cmd = gcnew SqlCommand("select top 10 Name from
> sys.objects",%conn);
> /*
> SqlDataReader also needs cleanup, but it is returned from the
> SqlCommand as a handle
> so we can't use automatic storage for it. So a try/finally block
> guarantees cleanup.
> */
> SqlDataReader^ rdr = cmd->ExecuteReader();
> try
> {
> while (rdr->Read())
> {
> System::Console::WriteLine(rdr[0]);
> }
> }
> finally
> {
> rdr->Close();
> }
> }
> int main(array<System::String ^> ^args)
> {
> try
> {
> Run();
> return 0;
> }
> catch (Exception^ ex)
> {
> Console::WriteLine(ex);
> return 1;
> }
> }
>
>
G'Dave,
Thanks for the code - at least it now compiles.
When I run the EXE I am now faced with connection errors so now assume
that I need to pay more attention on how I installed SQL Server.
So, back to the books to clear that up - I can use SQLCMD so I guess I
can't be too far away on getting it right.
Currently I have the server connecting with TCP (port 1403) and I see I
could also used:
Named Pipes
TCP
VIA
What is considered the better way to connect ?
I had a look at the configuration of the Server and found to be 'local
service'
Would I be better of using:
local system
or
network service
or
local service (current)
Cheers
Pete
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
-->>>>>>http://www.NewsDemon.com<<<<<<--
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access|||"Pete Moscatt" <peter.moscatt@.gmail.com> wrote in message
news:448b95c4$0$30209$b9f67a60@.news.newsdemon.com...
> David Browne wrote:
> G'Dave,
> Thanks for the code - at least it now compiles.
> When I run the EXE I am now faced with connection errors so now assume
> that I need to pay more attention on how I installed SQL Server.
> So, back to the books to clear that up - I can use SQLCMD so I guess I
> can't be too far away on getting it right.
> Currently I have the server connecting with TCP (port 1403) and I see I
> could also used:
>
You probably need an instance name in the "Data Source".
SqlConnection conn("Data Source=(local)\SQLExpress;Initial
Catalog=test;Integrated Security=True");
conn.Open();
And "Initial Catalog" is the database name.
I would generally use TCP/IP (remote) and Shared Memory (local).
> Named Pipes
> TCP
> VIA
> What is considered the better way to connect ?
> I had a look at the configuration of the Server and found to be 'local
> service'
>
As for what account you use to run SQL Server, it really depends on your
security setup. Usually either Local Service or Network Service is
appropriate. But sometimes you will want to use a Domain account.
David|||On Sun, 11 Jun 2006 11:10:50 -0500, "David Browne" <davidbaxterbrowne
no potted meat@.hotmail.com> wrote:
>"Pete Moscatt" <peter.moscatt@.gmail.com> wrote in message
>news:448b95c4$0$30209$b9f67a60@.news.newsdemon.com...
>
>You probably need an instance name in the "Data Source".
> SqlConnection conn("Data Source=(local)\SQLExpress;Initial
>Catalog=test;Integrated Security=True");
> conn.Open();
>And "Initial Catalog" is the database name.
>I would generally use TCP/IP (remote) and Shared Memory (local).
>
>
>As for what account you use to run SQL Server, it really depends on your
>security setup. Usually either Local Service or Network Service is
>appropriate. But sometimes you will want to use a Domain account.
>
>David
>
Thanks Dave, it all a good thing at the moment.
You have me enough info for me to let loose and work things out
myself.
Again, thanks for all the assistance you have given me on this issue.
Pete
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
-->>>>>>http://www.NewsDemon.com<<<<<<--
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Subscribe to:
Posts (Atom)