Home All Groups Group Topic Archive Search About
Author
15 Apr 2005 10:04 AM
Irfan Mumtaz
hi,
i was practising the famous 'northwind database' using vb.net sample
examples. But i am getting an error
'sql server does not exist or access denied'

connectionString = "Server=localhost;DataBase=;Integrated Security=SSPI"
Dim northwindConnection As New SqlConnection(connectionString)
Dim cmd As New SqlCommand(strSQL, northwindConnection)
northwindConnection.Open()    //error here

COULD SOMEONE PLEASE ADVICE.
I have got SQL Server 2005 installed in the system and i am using .net 2003

TIA
irfan

Author
15 Apr 2005 10:31 AM
JohnFol
In your connection string you do not include the database name. You could
try and open the connection using the Server Explorer. This would eliminate
your code. Then, drag the connection onto the designer window and you will
see the correct ConnectionString property.




Show quoteHide quote
"Irfan Mumtaz" <spamMe@spam.net> wrote in message
news:9993ADBC-8069-48EA-83F0-7A085C7101A4@microsoft.com...
> hi,
> i was practising the famous 'northwind database' using vb.net sample
> examples. But i am getting an error
> 'sql server does not exist or access denied'
>
> connectionString = "Server=localhost;DataBase=;Integrated Security=SSPI"
> Dim northwindConnection As New SqlConnection(connectionString)
> Dim cmd As New SqlCommand(strSQL, northwindConnection)
> northwindConnection.Open()    //error here
>
> COULD SOMEONE PLEASE ADVICE.
> I have got SQL Server 2005 installed in the system and i am using .net
> 2003
>
> TIA
> irfan
>
>
Author
15 Apr 2005 11:57 AM
Irfan
thanks for the replies
I used the server explorer and when i clicked on the Sql Servers, it is
giving me an sql server login dialog box
when i press OK, to enter password and when i press OK it gives
'SQL sever does not exists'.

Thanks again for the response

irfan


Show quoteHide quote
"JohnFol" <OutlookExpr***@WibbleObbble.Com> wrote in message
news:yKM7e.6904$It4.1968@newsfe2-gui.ntli.net...
> In your connection string you do not include the database name. You could
> try and open the connection using the Server Explorer. This would
> eliminate your code. Then, drag the connection onto the designer window
> and you will see the correct ConnectionString property.
>
>
>
>
> "Irfan Mumtaz" <spamMe@spam.net> wrote in message
> news:9993ADBC-8069-48EA-83F0-7A085C7101A4@microsoft.com...
>> hi,
>> i was practising the famous 'northwind database' using vb.net sample
>> examples. But i am getting an error
>> 'sql server does not exist or access denied'
>>
>> connectionString = "Server=localhost;DataBase=;Integrated Security=SSPI"
>> Dim northwindConnection As New SqlConnection(connectionString)
>> Dim cmd As New SqlCommand(strSQL, northwindConnection)
>> northwindConnection.Open()    //error here
>>
>> COULD SOMEONE PLEASE ADVICE.
>> I have got SQL Server 2005 installed in the system and i am using .net
>> 2003
>>
>> TIA
>> irfan
>>
>>
>
>
Author
15 Apr 2005 1:03 PM
Philip Hristov
Irfan,

I am using WinXP SP2 and I cannot get connected to SQL Server either.
The solution is to use the name of your computer rather than localhost.
So if your computer is named 'irfan' use irfan. This happends due some
changes in SP2 of XP. I thnk these changes are implemented in SP1 for
Win2003 too.

Regards,

Philip.
Author
15 Apr 2005 1:53 PM
Irfan
I tried your suggestion also but still the same thing.
BTW, how do i know that northwind is installed on SQL server. If it isnt
then how do i install it

regards,
irfan


Show quoteHide quote
"Philip Hristov" <phristo***@gmail.com> wrote in message
news:1113568169.974327.86800@o13g2000cwo.googlegroups.com...
> Irfan,
>
> I am using WinXP SP2 and I cannot get connected to SQL Server either.
> The solution is to use the name of your computer rather than localhost.
> So if your computer is named 'irfan' use irfan. This happends due some
> changes in SP2 of XP. I thnk these changes are implemented in SP1 for
> Win2003 too.
>
> Regards,
>
> Philip.
>
Author
15 Apr 2005 9:48 PM
Philip Hristov
Irfan, Northwind is included in SQL Server Developer Edition and
Enterprise. It is not included in MSDE 2000.

Philip.
Author
15 Apr 2005 10:47 AM
Herfried K. Wagner [MVP]
"Irfan Mumtaz" <spamMe@spam.net> schrieb:
> i was practising the famous 'northwind database' using vb.net sample
> examples. But i am getting an error
> 'sql server does not exist or access denied'
>
> connectionString = "Server=localhost;DataBase=;Integrated Security=SSPI"

Make sure you are using a complete connection string (at least the database
name is missing).  You'll find connection strings for SQL Server at
<URL:http://www.connectionstrings.com/>.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
15 Apr 2005 11:40 AM
Cor Ligthert
Irfan
>
> connectionString = "Server=localhost;DataBase=;Integrated Security=SSPI"
> Dim northwindConnection As New SqlConnection(connectionString)
> Dim cmd As New SqlCommand(strSQL, northwindConnection)
> northwindConnection.Open()    //error here
>
In my opinion is there most probably nothing wrong with your Connection
string and it depends for what you are using it, however it does not access
the northwind database, so when your SQL string contains a table for that it
will not be processed.

You can try this one by setting "USE Northwind"  as first in your Select
statement.
(Or change the connection string when you don't have to create or to drop
that database what is not likely in this case by just changing
DataBase=Northwind)

However it is in fact not wrong.

I hope this helps,

Cor
Author
15 Apr 2005 1:13 PM
Irfan
I wrote the DataBase=Northwind, but still it gives the same error. 'Sql
server does not exist'.

BTW, how do i know if the Northwind is installed on the sql server and if it
isnt how do i install it.

TIA

irfan
Show quoteHide quote
"Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message
news:%23Cqmo$aQFHA.3356@TK2MSFTNGP12.phx.gbl...
> Irfan
>>
>> connectionString = "Server=localhost;DataBase=;Integrated Security=SSPI"
>> Dim northwindConnection As New SqlConnection(connectionString)
>> Dim cmd As New SqlCommand(strSQL, northwindConnection)
>> northwindConnection.Open()    //error here
>>
> In my opinion is there most probably nothing wrong with your Connection
> string and it depends for what you are using it, however it does not
> access the northwind database, so when your SQL string contains a table
> for that it will not be processed.
>
> You can try this one by setting "USE Northwind"  as first in your Select
> statement.
> (Or change the connection string when you don't have to create or to drop
> that database what is not likely in this case by just changing
> DataBase=Northwind)
>
> However it is in fact not wrong.
>
> I hope this helps,
>
> Cor
>
>
>
Author
15 Apr 2005 1:59 PM
Cor Ligthert