Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Tuesday, March 27, 2012

Connecting to SQL Server 2005 - Not Allow Remote Connections

I use ASP.NET 2.0 and VS.NET 2005.

I have the following expression in my code:

string connectionString = "server=\'localhost\'; user id=\'sa\'; password=\'\'; Database=\'Northwind\'";

When I executed the code I have the following error message:

"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)."

The Microsoft Access was successfully connected in the Server Explorer window.

How do I solve this problem?

Thanks,

Andy.

Try this thread for the two links you need to get it going. Hope this helps.

http://forums.asp.net/thread/1381596.aspx

|||

From your link, I found the following link http://support.microsoft.com/default.aspx?scid=kb%3bEN-US%3b914277. I have followed all the instructions from that page, but I still receive the same error message.

I am not sure which version of SQL I am using. From the "start" -> "All Programs", I can only see "Microsoft SQL Server". It was installed, when I installed Microsoft Visual Studio 2005 Professional.

Andy.

|||If you have the professional you should have the Developer edition CD separately, copy the content to your hard drive and install it as a named instance and then use the instructions for the developer edition. Hope this helps.

Connecting to SQL Server 2005

Hi all,
I have Windows XP SP2 and SQL Server 2005 CTP installed on my machine.
I am trying to connect to the database in a ASP.net application but no matter how much i try i get the following error message : System.Data.SqlClient.SQLException:SQL Server does not exist or Access denied

I have tried to fix the problmm by checking in all the online blogs and trying out whatever is being suggested , still no luck!!!Sad

Would appreciate if anybody could help me

Thanks.
sshettyThe folks on the SQL Server Data Access forum (http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=87) should be able to help you out with this one.

Raman Iyer
SQL Server Data Mining

Connecting to SQL Server 2005

I installed the SQL Server 2005 Trial and am now having trouble connecting. When I bring up the ASP.NET Configuration tool and Go to "Provider configuration" "Select a single provider for all site management data" AspNetSqlProvider Test I get the following message.

"Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider. "

I have already run the aspnet_regsql command-line utility.

Can anybody give me some information on how to set this up.

I am currently working with the club web site starter kit.

I first recommend you go grab this awesome management tool for the express edts :

http://www.microsoft.com/downloads/details.aspx?familyid=82afbd59-57a4-455e-a2d6-1d4c98d40f6e&displaylang=en

I would then first check to see if your connections to the DB work with this tool and copy the connection strings it gives you and use them in your app. Also, you can configure ASPNETDB from the web.config level and dont have to use the web tool. This way you can test directoly to ASPNETDB. I havent used the club starter kit but im sure it either uses app_data or aspnetdb in the db. All you have to do is point to the right one. I wrote a couple blogs on this :

http://eramseur.blogspot.com/2005/12/aspnet-20-create-custom-provider-for_10.html

I would also check out scotts entry :
http://weblogs.asp.net/scottgu/archive/2006/02/24/438953.aspx

He has another article about how to get membershp up in 15 minutes and you should look at that too.

Connecting to SQL Server 2000 thru a VPN?

Is this even possible?
I'm coding a VB.NET WinForms app and an ASP.NET app that will access a MS
SQL 2000 Server. I've been told that when I move into a "production"
environment that I must go thru a VPN. I'm no VPN expert, but this doesn't
make much sense to me especially since the remote clients running my VB.NET
WinForms app may not have teh VPN setup.
If VPN can be used as a tunnel to access a SQL 2000 Server, can someone tell
me what needs to be in place on the client side and what would I use for a
connection string to get to the SQL 2000 Server thru the VPN.
I can't find any info on MSDN that even mentions how to connect to a SQL
2000 Server thru VPN.
Thanks, Rob.
Hi Rob,
The VPN session needs to be established prior to executing your VB.NET
app. There's not a specific connection string to do this.
Here's a sample kb article on how to setup a VPN with our firewall server ,
ISA Server.
837355 How to configure a VPN server by using Internet Security and
http://support.microsoft.com/?id=837355
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Connecting to SQL Server (Local Machine)

Hi all,

Apologies if this is a dumb question, but I'm tearing my hair out over the basics when I should be spending time learning ASP.NET 2.0 and C#. I've searched the archives and a lot of people seem to be getting the same error as me, but when trying to connect from remote machines.

I'm getting what seems to be a standard message ...

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I'm not trying to connect remotely, I'm on my developer machine. The error comes up when trying to connect from within VS2005 (Tools, Connect to Database). It also comes up if I create a new web-site and go to the ASP.NET configuration tool (this is, I guess, trying to create the necessary database behind the scenes but is unable to connect to the database).

I suspect the error might be related to one or more of the following ...

September last year I installed VS2005 Express and SQL*SERVER Express. Both were fully un-installed when I bought VS2005 Professional before installing the new product.

When I set up SQL*SERVER 2005 Developer I remember choosing an option to have a separate user on my PC with administrative rights. Actually I don't recall much about what I chose but I can't find out where those permissions are managed from.

I've followed various instructions to check that remote access is enabled (despite the fact that I'm local, not remote). TCP and Named Pipes are both enabled (and I stopped then restarted SQL Server). I've checked that the service is started.

The odd thing is that I have had an application connect with the following string ...

SSLCon = new SqlConnection(@."Server=(local)\SSLMJ;Integrated Security = True;" + "Database=SSLTESTRESULTS");

Though the application connection seems to work ok, I think I'm missing out lots of developer functionality because I can't get VS2005 to see the database or server.

Help ?

Further info ...

I found and checked my machine.config file which has the following section ...

<connectionStrings>

<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />

</connectionStrings>

Could the reference to SQLEXPRESS be causing my problem ? How do I correct this ?

|||Tried commenting out the line beginning <add, but no effect.|||If you are connecting to the Express Edition instance on the same machine as it is running, you do NOT need to configure remote connections. Take a look at your services and see if the SQL Browser service is running. If it isn't running, start the service and try connecting again.|||

Thanks Michael. Using the Surface Area tool I've checked that the database engine and broswer are both running. Agent is not running. Remote Connections are set to both local and remote using both TCP and Named Pipes. However, I'm connecting locally (or trying to).

I'm using SQL Server 2005, not Express.

I don't understand why my application code can connect, but VS2005 can't ?

|||

Sorted - though I don't know why this worked.

Without changing any setup info ...

- went to configure my SqlDataSource as normal

- Instead of expanding the listbox for "Server Name" and finding it empty I typed the fully qualified name "MICKSPC\SSLMJ"

- expanded the list of database names - there they were !

I'd still like to know why VS couldn't find my server ? Any ideas ? "MicksPC" is there in Server Explorer. Expanding it shows the following ...

- Crystal Reports Services

- Event Logs

- Management Classes

- Management Events

- Message Queues

- Performance Counters

- Services

Under services is listed "SQL Server (SSLMJ)" and the properties for that service show it is running with a service name of MSSQL$SSLMJ.

Sunday, March 25, 2012

Connecting to SQL Issue

I have a mdf file and log file from msde. I have successfully connected to it in my Visual Studios ASP.net 2.0 Desktop. I am having a problem where it connects. fine but it does not list the tables , diagrams etc. I am trying to build the intake screen with this data but have no tables. Can some one give me a couple of suggestions of why? I am very new to ASP.net and would appreciate any help .How did you connect to the MSDE mdf file? Can you create a Data Connection to it in Server Explorer? Which SQL instance are you using (MSED,SQL Express, etc.)?|||

Hello,

I am using SQL Server Management Studio that came with my visual studios .net 2005.

I open my web application to the design desktop select the tab labeled Server Express the click on the data base to connect it tell me it is connected but no tables show. I was told today by some one I need to be running SQL Server Studio Express I dont understand is the one I have better? The also told me the mdf file was a backup file which they said I need to create a database and then import the mdf backup file into it . I can figure out how to do this I am very new to SQL Server. Help please

Thanks

|||Where does the mdf file come from? Anyways you should attach it to your current SQL instance before you can use it. To do this in Managment Studio, right click Databases in Object Explorer->choose Attach->locate the mdf file. If attach succeeds, you'll see the new attached database under the Databases tree.|||

Thank you,

I found the mdf file to be a bak file I created anew database and restored over the database I created. All tables showed up ok. I only have on question everything seem to work fine except I have no diagrams under the database is this normal not to have this information?

sqlsql

Connecting to SQL Failed

I am trying to connect to SQL following the directions in Learn ASP.NET in 24 hours I am on page 332-334 where i try to create a Data base for the first time.

I am using a localhost configuration.

I get the following message

"Unable to connect to database server.

SQL does not exist or access denied.

ConnectionOpen(Connect())"

However I see that SQL server(SQLEXPRESS) and SQL server browser are both running and their start state is automatic

Hi,

You can reach SQLEXPRESS instance as ComputerName\SQLExpress

connecting to SQL db in an asp.net page

Ok, I'm an experienced asp developer switching to asp.net.

I've used the "Quickstart Tutorials" (http://www.asp.net/Tools/redir.aspx?path=quickstart) and have gotten started that way and built a few things based on that, but they only show XML connection info. Now I need to switch to SQL so I can connect to MS SQL Server for some stored procedures.

Anyone have suggestions?

(I've dug through some articles on msdn, etc, but I've only found so far theory and not code. And let me tell 'ya, I'm big on learning about code from code.)

If this helps, the specific tasks I'm trying to do are:
Have user select a static value from a drop down list, enter a word in a text box, and submit the form (so far so good), which connects to the db and returns the datagrid filled with results (the part I don't have). I already have my sp, just can't connect to it and get results back into the page.The Tutorials on this site have an example of doing just that. Check outPerforming a Parameterized Select

Sound like you have all of the pieces you need, you just need to stitch them together. Viewing the source code of that example should help you do just that. Post back if you are having trouble implementing it.

Terri|||I receive this error:

Server Error in '/Test1' Application.
------------------------

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested Url: /Test1/VB/datagrid2.aspx|||The problem is probably with the SqlConnection -- specifically, it is trying to read the connection string out of the web.config file. This is a good practice. But, let's try to get the sample running for you first.

Instead of this line:

MyConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("PubsString"))

Try this line (assuming you are using a local SQL Server with Windows authentication)
MyConnection = New SqlClient.SqlConnection("server=(local);database=pubs;Trusted_Connection=yes")

Terri|||Ok, I'm looking at these various example ways to set up and connect to dbs.

I have a local sql server running on my machine.
I can use the sa account.
I have databases, sps, and tables already on it.

I've tried looking at the examples and changing to fit, but either I'm missing something or I've put info in the wrong place.

hum.|||YAY YAY YAY!!!

Thank you! I changed your line:
MyConnection = New SqlClient.SqlConnection("server=(local);database=pubs;Trusted_Connection=yes")

To:
MyConnection = New SqlClient.SqlConnection("server=(local);database=mydbname;uid=sa;pwd=sa;")

and it works in the datagrid2.aspx sample file! 8)

Whew!

Ok, now time to get this working in my files...

Thanks again!

Connecting to SQL 6.5 with VB.NET

Hi,

I am trying to connect to a SQL 6.5 database with VB.NET.

Is this possible, and if so, what kind of connection string is used and what mode of data access (OleDB, ODBC, etc.)

I have had several problems doing this and I am starting to wonder if there is anything special that needs to be done or if it is even possible. Thanks in advance!OleDB. Check out http://www.connectionstrings.com/|||Alright, I tried creating an OleDB Connection using Visual Studio. I set up the connection and it connects fine. I can view the tables and it says that it connects to the datasource. But when I try to use the connection in the page I get this error:

System.ArgumentException: The .Net Framework Data Provider for OLEDB (System.Data.OleDb) does not support the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL). Use the .Net Framework Data Provider for ODBC (System.Data.Odbc). at System.Data.OleDb.OleDbConnectionString.ValidateNotMSDASQL(String progid) at System.Data.OleDb.OleDbConnectionString.ValidateParse() at System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) at System.Data.OleDb.OleDbConnectionString.ParseString(String connectionString) at System.Data.OleDb.OleDbConnection.set_ConnectionString(String value) at ask.testconn.Page_Load(Object sender, EventArgs e) in \\cnsrfdiis01\intranet\ask\testconn.aspx.vb:line 31

Why would it be able to connect in the VS.NET Server Exlporer, but not in a page. I am just trying to open the database and close it. Here is the connection string I am using:

Provider=SQLOLEDB;Persist Security Info=False;User ID=crystal;Initial Catalog=lmsprod;Data Source=10.1.121.22;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=AROCAPTEST;Use Encryption for Data=False;Tag with column collation when possible=False

Thanks in advance!|||Ok, I was wrong. I went and checked, and you should be using the ODBC driver. Sorry. Try that and see if you still have the error.

Thursday, March 22, 2012

Connecting to SQL 2005 server on Windows 2003

Hope this is on the correct forum, if not could the admins move please.

Im running Win XP SP2 Pro + All updates, Visual Studio .Net 2005 and SQL 2005. SQL is running on Win 2003 server. When i try to create a connection on the WinXP system using ODBC i get the following error:

Connection Failed:
SQLSTATE: '01000'
SQL Server Error: 233
[Microsoft] [ODBC SQL server driver][DBNETLIB]Connection open (PreLoginHandshake())
Connection failed:
SQLState: '08001'
SQL Server error: 11
[Microsoft] [ODBC SQL server driver][DBNETLIB]General Network error. Chcek your network documentation.

Ive searched about the error but nothing seems to work - can anyone help to resolve please?

Thanks in advance.

1) Are you making remote connection? If you have SQL 2005 installed on your XP client box, can you try Management studio to connect to remote server? what error you see?

2) Did you install SQL Express 2005 and make remote connection?If so, check this blog:

http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx

But I do not think this is the case.

3) more GNE error troubleshooting blog:

http://blogs.msdn.com/sql_protocols/archive/2006/04/12/574608.aspx

Might give you some clue.

Summary, to fix your problem, please:

check our anouncement posted by Nan Tu, provided the answer to the questions for troubleshootin connectivity issue.

Thanks!

Ming.

Connecting to remote sql server 2005

Dear All,

I am quite new to sql server 2005. Now I am going to develop a new asp.net application connecting to sql server 2005 remotely. So what must I have install in order to connect to a remote sql server and also to enable me build the tables too? What are the softwares that I need to install before I can proceed on this ? If possible I wnat to avoiding installing the whole server into my local machine as I dont need it. Thanks.

You might find these to be good resources to get you started out.

http://asp.net/learn/dataaccess/default.aspx?tabid=63

http://asp.net/learn/videos/default.aspx?tabid=63

http://msdn.microsoft.com/vstudio/express/sql/learning/default.aspx

|||

Dear Arnie,

Thanks for the link. Thus that means minimally I must install the sql express is it? Thanks.

|||

No, you do not 'have' to install SQL Express.

However, you might benefit from having a local copy to learn with and explore.

Minimally, you will need a client tool or environment that will connect to the SQL Server.

That client environment 'could be' Visual Studio.

It could also be the SQL Server Management Studio Express client tool.

|||

Dear Arnie,

I dont mind installing the express version. But I just want to know is it the same like the orginial sql server 2005 ? Thanks.

|||

Every thing that you can do in SQL Express, you can do in the other editions. SQL Express is the same product code base.

However, there are a few 'enterprise' level features that are not included in SQL Express. Integration Services and Replication are a couple that come to mind.

You can compare the editions here to get a better idea. (However, for learning how to use SQL Server to support a web site, SQL Express will be a good tool for you.)

SQL Server 2005 Features, Version Comparison
http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx

|||

Dear Arnie,

Thank you a lot of man all your information was very helpful. So I will start working with it. So in case I am stuck then I will get back to you. Really appreciate you a lot.

|||

Dear Arnie,

Ok I have download both the sql express and also the sql server managment studio express. I all working i can log into my database. The problem is that it is using the windows authentication. I would like to make my own account and create a user name and password. I dont know how to go about ? Can you please help me on this ? Thanks.

|||

You might find the tutorial videos on these sites to be well worth your time and effort.

For SQL Server (especially Lesson Seven):

http://msdn.microsoft.com/vstudio/express/sql/learning/default.aspx#1

For ASP:

http://asp.net/learn/videos/default.aspx?tabid=63

Tuesday, March 20, 2012

Connecting to remote database?

I am using SQL Server 2000 database in my VB.Net project.

My VB.net application is installed one two machines in different cities i.e. there are two separate databases.

First machine's IP address is say 202.33.44.55 and other machine IP address is say 203.33.55.66. Now I want to use each others databases i.e. I want to set their database group.

So that in my VB.Net's application which is installed on 202.33.44.55 I could see data of the 203.33.55.66 by just changing the connection string

You can include both connection strings in the web.config and then change the data source via dynamic code.

This method works well when there are applications running on the server with each using a different data source.

The web.config might look like this:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<clear />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=servername;Initial Catalog=database;User ID=user;Password=password;" providerName="System.Data.SqlClient" />
<remove name="ConnectionString1"/>
<add name="ConnectionString1" connectionString="Data Source=servername1;Initial Catalog=database1;User ID=user;Password=password;" providerName="System.Data.SqlClient" />
<remove name="ConnectionString2"/>
<add name="ConnectionString2" connectionString="Data Source=servername2;Initial Catalog=database2;User ID=user;Password=password;" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>

|||

harshal_shravgi:

I am using SQL Server 2000 database in my VB.Net project.

My VB.net application is installed one two machines in different cities i.e. there are two separate databases.

First machine's IP address is say 202.33.44.55 and other machine IP address is say 203.33.55.66. Now I want to use each others databases i.e. I want to set their database group.

So that in my VB.Net's application which is installed on 202.33.44.55 I could see data of the 203.33.55.66 by just changing the connection string

There is nothing dynamic in this Asp.net needs an account in the second server which should be added to SQL Server and the database, so you need to create a Windows account for Asp.net in the second server and grant that account permissions to SQL Server and the database. Hope this helps.

|||

Actually I want to set their database groups and as I said those two machines are not in my LAN. Those two machines are in different cities.

When I try setup a new sql group then I cann't see 203.33.55.66 from 202.33.44.55.

Above two IP addresses will be live IP address.

|||

harshal_shravgi:

Actually I want to set their database groups and as I said those two machines are not in my LAN. Those two machines are in different cities.

When I try setup a new sql group then I cann't see 203.33.55.66 from 202.33.44.55.

Above two IP addresses will be live IP address.

I have told you what you need to do location is not relevant if you do it your application will run, some of these security issues are created by developers who thinks database servers should let their application run without valid permissions.

|||

In my code I am using following connection string -

Provider=SQLOLEDB.1;Data Source=202.33.44.55;Initial Catalog= SLV2;UserId=sa;Password=;

It gives error that database does not exist.

What should I give datasource that database does not exist on my machine i.e. 203.33.55.66? And as I said when I tried to setup a new group in SQL Server then its not showing me that other machine database.

So I think its not the issue of coding, firstly I should be able set a group of databases in SQL Server then only I will be able to use it in my code.

|||

Hi,

You also need to check if the SQL Server instance you're connecting to is the default instance on 203.33.55.66. Is the instance on the default port 1433?

Please also check if the database named SLV2 exists on that machine and if sa with no password is a valid user name.

You can test this with SQL Server management studio or with a UDL file. Here are the steps creating a UDL file.

1. Create a text file on your desktop and rename it to XXX.udl
2. Double click on the file and a Data Link Property dialog box will be shown.
3. Setup the connection and use Test Connection button to test it.

HTH.

|||

Exactly when I tried to connect using .UDL file I didn't found that other machine.

So what to do now?

|||

harshal_shravgi:

Exactly when I tried to connect using .UDL file I didn't found that other machine.

So what to do now?

You need to create a domain account for Asp.net then grant that account permissions in SQL Server and database, sa is not a Windows account.

http://support.microsoft.com/kb/328306

|||

Hi,

And you can also connect to the database using SQL authentication. But the server should enable SQL authentication first.

HTH.

Connecting to pervasive via ODBC

Has anyone successfully imported data from pervasive over the .net managed odbc bridge? Our admin has set up a odbc connection that works through Excel, but in SSIS the connection manager errors when trying to connect at runtime (the "test connection" button in the connection wizard reports that everything is ok though).

What error are you getting?|||

"Data source name not found and no default driver specified"

|||

A bit more info on this:

The connection seems to work in design time as metadata is fetched from the datasource to populate the column mappings in the datareader source|||

For anyone interested:
This was an issue with running the ODBC driver (presumably 32 bits) in 64bit mode. Running the package in 32 bit mode fixed the problem.

Monday, March 19, 2012

Connecting to MS SQL server 2000 from the different domains using asp.net

Hi,

My problem is somewhat like this that, i want to connect my all applications (developed in asp.net) to one database. In other words i want to make a centralised database that can be accessible from the application running at the different domains. When i did so by using the same username, password, database and server...i recieve an error that,"connection cannot be establised".

If any body have the solution for this problem. then please do write the "connection string" for me that can be efficiantly used on the applications running on differnt domains.

Thanks and Regards,

Steve Dcosta

Considering the domains trust each other and that you have the proper rights for accessing the database server from each of the different domains you can try the following connectionString replacing the correct values for the variables:

data source=putIPHereIncaseNameResolutionFails;user id=user;password=yourPassword;initial catalog=databaseName;persist security info=True

Connecting to Microsoft SQL Server

Hi. Im just starting to learn Microsoft Visual Basic .Net, I'm having problem connecting to Microsoft Sql Server for the sample database Northwind. I can see SQL Server Service Manager on my taskbar but not connected. Please help thanks.
Chris,[vbcol=seagreen]
Whats the error?
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Chris" <anonymous@.discussions.microsoft.com> wrote in message
news:3E1B5EE1-9707-46D7-8142-B9264FD52ABC@.microsoft.com...
> Hi. Im just starting to learn Microsoft Visual Basic .Net, I'm having
problem connecting to Microsoft Sql Server for the sample database
Northwind. I can see SQL Server Service Manager on my taskbar but not
connected. Please help thanks.
|||...this is the error. Test Connection Failed because of an Error in initializing provider. [DBNETLIB][COnnection Open(Connect()] SQL Server does not exist or Access Denied. I hope you could help me!!!
|||Chris,
See if its due to any of the scenarios mentioned in the below article:
'Potential causes of the "SQL Server Does Not Exist or Access Denied" error
message'
http://support.microsoft.com/?id=328306
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Chris" <anonymous@.discussions.microsoft.com> wrote in message
news:9F5AAE66-7434-4F9D-971B-B94733F9FF60@.microsoft.com...
> ...this is the error. Test Connection Failed because of an Error in
initializing provider. [DBNETLIB][COnnection Open(Connect()] SQL Server does
not exist or Access Denied. I hope you could help me!!!

Connecting to Microsoft SQL Server

Hi. Im just starting to learn Microsoft Visual Basic .Net, I'm having proble
m connecting to Microsoft Sql Server for the sample database Northwind. I ca
n see SQL Server Service Manager on my taskbar but not connected. Please hel
p thanks.Chris,
Whats the error?
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Chris" <anonymous@.discussions.microsoft.com> wrote in message
news:3E1B5EE1-9707-46D7-8142-B9264FD52ABC@.microsoft.com...[vbcol=seagreen]
> Hi. Im just starting to learn Microsoft Visual Basic .Net, I'm having
problem connecting to Microsoft Sql Server for the sample database
Northwind. I can see SQL Server Service Manager on my taskbar but not
connected. Please help thanks.|||...this is the error. Test Connection Failed because of an Error in initial
izing provider. [DBNETLIB][COnnection Open(Connect()] SQL Server doe
s not exist or Access Denied. I hope you could help me!!!|||Chris,
See if its due to any of the scenarios mentioned in the below article:
'Potential causes of the "SQL Server Does Not Exist or Access Denied" error
message'
http://support.microsoft.com/?id=328306
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Chris" <anonymous@.discussions.microsoft.com> wrote in message
news:9F5AAE66-7434-4F9D-971B-B94733F9FF60@.microsoft.com...
> ...this is the error. Test Connection Failed because of an Error in
initializing provider. [DBNETLIB][COnnection Open(Connect()] SQL Ser
ver does
not exist or Access Denied. I hope you could help me!!!

Connecting to localhost Problems?

I'm taking a .NET class and I have SQL Server 2005 installed on my
machine. When I go into Studio and then select Server Explorer and try
to add a new Connection, it seems to bomb out when I type in
'localhost' for the server name. It doesn't come back with anything
for the DBS. Is there something I need to do to get my machine to
understand 'localhost'?"Rick" <rlc_60504@.yahoo.comwrote in message
news:1162528400.038379.136840@.h54g2000cwb.googlegr oups.com...

Quote:

Originally Posted by

I'm taking a .NET class and I have SQL Server 2005 installed on my
machine. When I go into Studio and then select Server Explorer and try
to add a new Connection, it seems to bomb out when I type in
'localhost' for the server name. It doesn't come back with anything
for the DBS. Is there something I need to do to get my machine to
understand 'localhost'?


Very likely you have SQL 2005 installed as a named instance, so you have to
specifically provide the hostname AND isntance name.

Quote:

Originally Posted by

>

Sunday, March 11, 2012

Connecting to DB Stored Proc with asp.net

I am used to using asp and i am trying to connect to a db and bring back a recordset from a stored procedure in asp.net, but I am getting the following error;

Server Error in '/' Application.

Object variable or With block variable not set.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:System.NullReferenceException: Object variable or With block variable not set.
Source Error:

Line 58: Line 59: qry = "AWS_RPT_WEB_MAGSUBSSTATS_PROC "Line 60: rs = dbConn.Execute(qry)Line 61: %>Line 62:

Source File:D:\Program Files\IntranetDASHBOARD\wwwroot\ufr\publications\dpe\live\65.aspx Line:60
Stack Trace:
[NullReferenceException: Object variable or With block variable not set.] Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +927 ASP._65_aspx.__RenderForm1(HtmlTextWriter __output, Control parameterContainer) in D:\Program Files\IntranetDASHBOARD\wwwroot\ufr\publications\dpe\live\65.aspx:60 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +44 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +260 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +241 ASP._65_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) in D:\Program Files\IntranetDASHBOARD\wwwroot\ufr\publications\dpe\live\65.aspx:52 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27 System.Web.UI.Control.Render(HtmlTextWriter writer) +7 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +241 System.Web.UI.Page.ProcessRequestMain() +1926

Check the following :

Whether the appropriate dll's for data provider such as System.Data.dll,System.Data.OracleClient.dll are added to the references.

And make sure your connection object has connectionString property

Make sure the connection is opened prior to execute statement

|||

...and have you properly created "dbConn"?

Connecting to cluster instance from .NET

Hi
Apologies if this isn't the right forum.
I have an instance of sql (2005) setup called SQL1\SQL1
I am trying to connect to a database (hm1) using the following connection
string in my web.config:
server=SQL1\SQL1;database=hm1;uid=hm1;pwd=hm1;
...but it can't find it. I need to know if this is the correct way to
address an instance in the connection string - I've tried
server=10.0.0.8\SQL1;
and
server=10.0.0.8;database=SQL1\hm1;
But neither work. On the SQL server itself, apart from naming the instance,
are there any other configuration settings I might be missing? (Unfortunately
I didn't set the server up and I know next to nothing about SQL clustering)
I feel like this a bit of a dumb question but any help really appreciated.
Ed
Will this help:
http://www.connectionstrings.com/?carrier=sqlserver
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
..
"edwaldo" <edwaldo@.discussions.microsoft.com> wrote in message
news:C37E6C7F-DC56-46F1-9001-32104E89F9D0@.microsoft.com...
Hi
Apologies if this isn't the right forum.
I have an instance of sql (2005) setup called SQL1\SQL1
I am trying to connect to a database (hm1) using the following connection
string in my web.config:
server=SQL1\SQL1;database=hm1;uid=hm1;pwd=hm1;
...but it can't find it. I need to know if this is the correct way to
address an instance in the connection string - I've tried
server=10.0.0.8\SQL1;
and
server=10.0.0.8;database=SQL1\hm1;
But neither work. On the SQL server itself, apart from naming the instance,
are there any other configuration settings I might be missing?
(Unfortunately
I didn't set the server up and I know next to nothing about SQL clustering)
I feel like this a bit of a dumb question but any help really appreciated.
Ed
|||And take a look at http://support.microsoft.com/kb/328306. Connecting to a
clustered instance is not that different from connecting to a standalone
instance.
By the way, when you said "it can't find it", what was it, the server or the
database?
Linchi
"edwaldo" wrote:

> Hi
> Apologies if this isn't the right forum.
> I have an instance of sql (2005) setup called SQL1\SQL1
> I am trying to connect to a database (hm1) using the following connection
> string in my web.config:
> server=SQL1\SQL1;database=hm1;uid=hm1;pwd=hm1;
> ..but it can't find it. I need to know if this is the correct way to
> address an instance in the connection string - I've tried
> server=10.0.0.8\SQL1;
> and
> server=10.0.0.8;database=SQL1\hm1;
> But neither work. On the SQL server itself, apart from naming the instance,
> are there any other configuration settings I might be missing? (Unfortunately
> I didn't set the server up and I know next to nothing about SQL clustering)
> I feel like this a bit of a dumb question but any help really appreciated.
> Ed
|||Thanks for your help - I'll take a look at that article.
I'm getting the message 'SQL Server does not exist or access is denied" in
my .NET app. Not sure if it's the server or the database that I can't
connect to, I can ping the server but that's it. Is there a simple way to
test database connectivity to the instance from my web server?
Thanks again.
"Linchi Shea" wrote:
[vbcol=seagreen]
> And take a look at http://support.microsoft.com/kb/328306. Connecting to a
> clustered instance is not that different from connecting to a standalone
> instance.
> By the way, when you said "it can't find it", what was it, the server or the
> database?
> Linchi
> "edwaldo" wrote:
|||> I'm getting the message 'SQL Server does not exist or access is denied" in
Then that KB article will definitely help. At least, it would get you close
to what may have caused it. If not, post back with what you have tried.
Linchi
"edwaldo" wrote:
[vbcol=seagreen]
> Thanks for your help - I'll take a look at that article.
> I'm getting the message 'SQL Server does not exist or access is denied" in
> my .NET app. Not sure if it's the server or the database that I can't
> connect to, I can ping the server but that's it. Is there a simple way to
> test database connectivity to the instance from my web server?
> Thanks again.
>
> "Linchi Shea" wrote:
|||Can you connect to it through SSIS or SQLCMD?
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
..
"edwaldo" <edwaldo@.discussions.microsoft.com> wrote in message
news:5EB601E4-CE5D-4A52-BCFE-B8C599CFEF89@.microsoft.com...
Thanks for your help - I'll take a look at that article.
I'm getting the message 'SQL Server does not exist or access is denied" in
my .NET app. Not sure if it's the server or the database that I can't
connect to, I can ping the server but that's it. Is there a simple way to
test database connectivity to the instance from my web server?
Thanks again.
"Linchi Shea" wrote:
[vbcol=seagreen]
> And take a look at http://support.microsoft.com/kb/328306. Connecting to a
> clustered instance is not that different from connecting to a standalone
> instance.
> By the way, when you said "it can't find it", what was it, the server or
> the
> database?
> Linchi
> "edwaldo" wrote:
|||Thanks to both of you for your help.
Is SQLCMD for Sql Express only? I am running Server 2005. The machine I'm
trying to connect FROM is not running SQL.
I hadn't heard of SSIS - do you know the syntax I should be using to test
connectivity?
Thanks,
Ed
"Tom Moreau" wrote:

> Can you connect to it through SSIS or SQLCMD?
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> ..
> "edwaldo" <edwaldo@.discussions.microsoft.com> wrote in message
> news:5EB601E4-CE5D-4A52-BCFE-B8C599CFEF89@.microsoft.com...
> Thanks for your help - I'll take a look at that article.
> I'm getting the message 'SQL Server does not exist or access is denied" in
> my .NET app. Not sure if it's the server or the database that I can't
> connect to, I can ping the server but that's it. Is there a simple way to
> test database connectivity to the instance from my web server?
> Thanks again.
>
> "Linchi Shea" wrote:
>
>
|||I should have said SSMS, not SSIS. (Too many acronyms to remember in SQL
2005!) SSMS = SQL Server Management Studio. Both it and SQLCMD (a command
line utility) are part of the SQL Server client tools. You should have
those on the server. If not, get the install disk and install them there.
At that point, you can log onto SQL Server locally. If you can't, then
there is probably a security issue - i.e. wrong login/password.
If that all works, then install the client tools on another machine and see
if you can connect to the server from them, using the same credentials as
you did previously. Let us know what happens and we can take it further.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
..
"edwaldo" <edwaldo@.discussions.microsoft.com> wrote in message
news:3B0450DF-DA21-4686-9B0C-E8EC65570459@.microsoft.com...
Thanks to both of you for your help.
Is SQLCMD for Sql Express only? I am running Server 2005. The machine I'm
trying to connect FROM is not running SQL.
I hadn't heard of SSIS - do you know the syntax I should be using to test
connectivity?
Thanks,
Ed
"Tom Moreau" wrote:

> Can you connect to it through SSIS or SQLCMD?
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> ..
> "edwaldo" <edwaldo@.discussions.microsoft.com> wrote in message
> news:5EB601E4-CE5D-4A52-BCFE-B8C599CFEF89@.microsoft.com...
> Thanks for your help - I'll take a look at that article.
> I'm getting the message 'SQL Server does not exist or access is denied" in
> my .NET app. Not sure if it's the server or the database that I can't
> connect to, I can ping the server but that's it. Is there a simple way to
> test database connectivity to the instance from my web server?
> Thanks again.
>
> "Linchi Shea" wrote:
>
>
|||Can you TELNET to the assigned service port? Say, for example, that SQL
Server is listening on TCP 1433. Then if you TELNET <ip address or server
name> <port number>, you should get a black screen, which means it
successfully connected. If it can't find the server or port, then you have
a server configuration issue. If you connect successfully, then you have a
client configuration issue.
Sincerely,
Anthony Thomas

"edwaldo" <edwaldo@.discussions.microsoft.com> wrote in message
news:5EB601E4-CE5D-4A52-BCFE-B8C599CFEF89@.microsoft.com...[vbcol=seagreen]
> Thanks for your help - I'll take a look at that article.
> I'm getting the message 'SQL Server does not exist or access is denied" in
> my .NET app. Not sure if it's the server or the database that I can't
> connect to, I can ping the server but that's it. Is there a simple way to
> test database connectivity to the instance from my web server?
> Thanks again.
>
> "Linchi Shea" wrote:
a[vbcol=seagreen]
the[vbcol=seagreen]
connection[vbcol=seagreen]
instance,[vbcol=seagreen]
(Unfortunately[vbcol=seagreen]
clustering)[vbcol=seagreen]
appreciated.[vbcol=seagreen]
|||Hello
I am working on this issue with Edwaldo
The problem comes when i try and add the SQL instance within the Enterprise
Manager or even if i try to TELNET to the server.
Any ideas? I have been thinking that this is something to do with the way
that the one to one NAT is configured on the firewall. As it is set for a
value of one at the Coventry end and the start ip address is 10.0.0.10 (which
is the old server and is working) So in the firewall rules they are showing
as being outside the NAT pool.
The issue i have is that changing the NAT pool size with alter the external
IP addresses of other servers which i can not really do. I can make the
change for a couple of seconds and test but then need to change it back.
Any help is greatfully received
Thanks for this
Gareth Collins
"Anthony Thomas" wrote:

> Can you TELNET to the assigned service port? Say, for example, that SQL
> Server is listening on TCP 1433. Then if you TELNET <ip address or server
> name> <port number>, you should get a black screen, which means it
> successfully connected. If it can't find the server or port, then you have
> a server configuration issue. If you connect successfully, then you have a
> client configuration issue.
> Sincerely,
>
> Anthony Thomas
>
> --
> "edwaldo" <edwaldo@.discussions.microsoft.com> wrote in message
> news:5EB601E4-CE5D-4A52-BCFE-B8C599CFEF89@.microsoft.com...
> a
> the
> connection
> instance,
> (Unfortunately
> clustering)
> appreciated.
>
>

connecting to asp.net website

I want to connect to a asp.net website...
does any1 know how to connect queries from the database to the website??
Tahttp://www.123aspx.com/directory.aspx?dir=74 & http://www.devarticles.com/c/a/ASP/Two-Ways-To-Connect-To-SQL-Server-2000-Via-ASP/ for your reference.