Showing posts with label denied. Show all posts
Showing posts with label denied. Show all posts

Monday, March 26, 2012

How to connect to sql server 2000 (asp.net)

hi everybody, i got this error in my code.

Server Error in '/' Application.


SQL Server does not exist or access denied.

Source Error:

 
Line 12:       Dim SQLConn As SqlConnection = New SqlConnection()
Line 13:                SQLConn.ConnectionString = ConfigurationSettings.AppSettings("ConnectionString")
Line 14:                SQLConn.Open()
Line 15:       
Line 16:       cmdLath = New SqlCommand ( _

my web.config

<configuration>

<appSettings>

<addkey="ConnectionString" value="DataSource=xxx;UID=xxx;pwd=xxx" />

<addkey="ConnectionString" value="Server=xxx.xxx.x.x;database=xxx;UID=xxx;pwd=xxx;Trusted_Connection=True"/>

</appSettings>

<system.web>

<sessionState cookieless="false" timeout="20"/>

<customErrorsmode="Off"/>

</system.web>

</configuration>

what seems to be a problem, please help me??Is your connection string correct (server address, username, password, etc.)? Does the user your authenticating as have the correct permissions on the database?

Ryan|||i ran into this problem a few weeks ago as well, like the previous poster stated, you have to make sure they have an account in the sql server itself, not just a windows account. So the problem isn't with your code (assuming no spelling errors or the such) but with the sql server authenticating the user name and password. Hope that helps.|||Besides the suggestions given above, make sure you have SQL Server Authentication configured to be Mixed mode. Checkthis for the configuration.|||To Strongtypes,

Yes, I write the correct server, database, username and password. basically i use sa account with password but it didn't work. I used sql server authentication mixed mode.|||To Darkempire and Alvin,

Thanks for the reply, You know I've done a lot of codes in my asp.net but unfortunately it appears errors in my webpage. This is my setup, my sql server 2000 is installed on other machine with the domain controller running windows server 2003. I have this local pc with my asp.net with web server(iis). I think that my web server does not locate my sql server database or my connection string is wrong but if I'm going to used my dreamweavermx to fetch data to my sql server database it will show up perfectly but when i code an asp.net and run in my localhost, bang errorrs.. please help me|||

Let's do a connection testing on teh .NET client machine: new a '.udl' file e.g. test.udl, then double click to edit it->switch to Provider tab and choose 'SQL Native Client' (which is the default provider when you add connectionstring element in your web.config)->click next to switch to Connection tab->entering connection information including login and pasword (the same as you connect to the SQL Server in DreamWeaver)->click Test Connection. If this succeeds, then the SQL Native Client provider is OK; otherwise there's something wrong with the SQL Native Client provider, so you need to change another provider.

To learn more about connection strings using different providers, you can visit:

www.connectionstrings.com

sql

Wednesday, March 21, 2012

how to connect asp.net to sql server 2k

i have this error in my asp.net

>Server Error in '/' Application.
>------------------------
>SQL Server does not exist or access denied.
>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.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
>Source Error:
>
>Line 23: Dim sText As String = "SELECT employeeid, firstname, lastname FROM Employees"
>Line 24: Dim cmd As SqlDataAdapter= New SqlDataAdapter(sText, sConn)
>Line 25: cmd.Fill(ds, "EmpTable")
>Line 26:
>Line 27: Session("MyData") = ds
>
>Source File: c:\inetpub\wwwroot\FormViewer.aspx Line: 25

and my connection string is :

>"server=localhost;uid=sa;Initial Catalog=Northwind;"

i tried a lot of codes but it doesn't work in sql server 2k but in mysql server it perfectly run. i installed my web server in my local machine with .net framework but my sql server 2k is installed in other machine with the domain controller setup. how im going to connect to my sql server 2k using asp.net codes. i learn some ideas that it better to code the connection string in web.config. is it ok? please please help me. im really out of mind.hi everybody, im a newbie in asp.net. my current language is vb/sqlserver2k. i have a problem in connecting asp.net to sql server2k because my sql server2k is installed in other machine and my web server is installed in my local machine together with my .net framework. i tried a lot of examples but none of this is working with application, it shows with an error "SQL Server does not exist or access denied."
can you give me a complete source step by step. i would really appreciate if anybody can help. thanks in advance|||Tryhttp://www.connectionstrings.com for connection string help. If you still can't get it working, is your SQL Server using SQL authentication or Windows authentication? What does your connection string look like (be sure not to post actual user names and passwords if you are using SQL authentication)?

Edit: I found your duplicate post on the same topic and joined it to this thread. Please do not post the same question multiple times. It only frustrates those who are trying to help you and dilutes the effort.|||how can i know what authentication am i using, sql authentication or windows authentication?
all i know that in my vb application i was using this connection string to connect to my sql server "provider=sqloledb;database=xxxx;server=xxxx;uid=xxx;pwd=xxxx" is that so simple in my vb but in asp.net i really don't know what is the correct connection. thanks anyway tmorton for your reply|||Use the connection string example under SQL Server, SqlConnection, Standard Security at connectionstrings.com.

You are using SQL authentication since you are using a user name and password to connect. If you were using Windows authentication there would be no user name or password; the credentials of the current user would be used.