|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
sql Server not foundhi,
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 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 > > 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 >> >> > > 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. 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. > Irfan, Northwind is included in SQL Server Developer Edition and
Enterprise. It is not included in MSDE 2000. Philip. "Irfan Mumtaz" <spamMe@spam.net> schrieb: Make sure you are using a complete connection string (at least the database > 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" 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/> Irfan
> In my opinion is there most probably nothing wrong with your Connection > connectionString = "Server=localhost;DataBase=;Integrated Security=SSPI" > Dim northwindConnection As New SqlConnection(connectionString) > Dim cmd As New SqlCommand(strSQL, northwindConnection) > northwindConnection.Open() //error here > 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 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 > > > Related to your other question as well
http://www.microsoft.com/downloads/details.aspx?familyid=413744d1-a0bc-479f-bafa-e4b278eb9147&displaylang=en I hope this helps, Cor
Paging by example - help - still no luck....
Get processes list problem (win 2000) Reading an XML file into a Dataset - problem forecolor of button ??? Collection Type BindingManagerBase Problem Hide members in a derived class Good book about VB.NET ? Response.Redirect("WebForm1.aspx") Sharing references/members |
|||||||||||||||||||||||