Showing posts with label localhost. Show all posts
Showing posts with label localhost. Show all posts

Friday, February 24, 2012

Connection string problem

Hi people,
I have my web application running on my machine and it works on the current machine where I have created the project when I type localhost on the web browser. I tried running the application from another machine within the same network by typing the IP address of the machine where my asp.net project is located, the application works, but SQL Server wouldn't allow connection to be made when I start calling data from the database. I have set Impersonate="true" in the web.config file. Am I doing something wrong here?
Here's the configuration on the web.config file

<identityimpersonate="true"/>

<appSettings>

<addkey="Connection"

value="Server=SQLOLEDB.1;Data Source=SQLServer;Initial Catalog=myDatabase;Trusted_Connection=True;"/>

</appSettings>


Please help....
Kero

When you do that you impersonate IUSR_COMPUTERNAME; so, in that scenario that account must have rights to the database.
I think you may have to use Sql Server authentication and pass a userid/pwd pair in your conn string.
|||Thanks ChicoUser,
I have sort out my impersonate problem by following one of the tutorials from microsoft website. I have set up a Customer user instead using Aspnet account on the machine and given appropriate permissions to access the files. In the Web.config file I have added impersonate =true and provided username and password which allows the created account to get access to my SQL SERVER. It's working now.
kero :)

Sunday, February 19, 2012

Connection string for reporting model

Hi,

I've just created a reporting model to use with my reports.

I have deployed the model to my localhost reporting server.

The name of my model is : mod_agentreporting

Can someone give me the right connection string that i have to use ?

Is there any advantage for using reporting models as datasources for reports

or a shared data sources ?

Thanks already in advance for your remarks.

Vincent

http://msdn2.microsoft.com/en-us/library/ms345238.aspx

btw, that's the top result you get by googling:

site:msdn2.microsoft.com +"report model" +"connection string"

Connection String for "local" connection

I'm running MSSQL2k on a Win2k box used as a webserver. I imagine that
using a "localhost" type of connection would be faster than referring to the
server name and thus invoking the DNS lookup. The connection string I am
using as an ASP include is:
Dim Connect
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.open "DRIVER={SQL
Server};SERVER=SERVERName;DATABASE=DBname;UID=USER id;PWD=Password;"
Thanks
Something even better would be to use OLEDB instead of ODBC. You can also
use (local) (with the parenthesis) instead of localhost to use named pipes
instead of TCP/IP but I'm not really sure is this will impact the
performance.
Replace localhost with 127.0.0.1 if you want to make really sure that the
DNS lookup has been shortcutted.
Finally, be default, the connections are pooled, so you shouldn't see any
improvement about shortcutting the DNS lookup.
S. L.
"MICHAEL SHIFFMAN" <mettaworks@.verizon.net> wrote in message
news:rSfAd.7050$1U6.2738@.trnddc09...
> I'm running MSSQL2k on a Win2k box used as a webserver. I imagine that
> using a "localhost" type of connection would be faster than referring to
> the server name and thus invoking the DNS lookup. The connection string I
> am using as an ASP include is:
> Dim Connect
> Set Connect = Server.CreateObject("ADODB.Connection")
> Connect.open "DRIVER={SQL
> Server};SERVER=SERVERName;DATABASE=DBname;UID=USER id;PWD=Password;"
> Thanks
>
|||MICHAEL SHIFFMAN (mettaworks@.verizon.net) writes:
> I'm running MSSQL2k on a Win2k box used as a webserver. I imagine that
> using a "localhost" type of connection would be faster than referring to
> the server name and thus invoking the DNS lookup. The connection string
> I am using as an ASP include is:
> Dim Connect
> Set Connect = Server.CreateObject("ADODB.Connection")
> Connect.open "DRIVER={SQL
> Server};SERVER=SERVERName;DATABASE=DBname;UID=USER id;PWD=Password;"
To echo what Sylvain said: change DRIVER=(SQL Server) to Provider=SQLOLEDB.
Changing providers is not entirely painless - some things may broke. But
the default OLEDB-over-ODBC driver is deprecated for SQL Server, and since
it means one extra layer, there is definitely an extra overhead.
The gain in performance you may get by chaning the SERVER parameter is
probably neglible. However, as long as you run SQL Server on the web
server - which is dubious practice - you gain some maintainability by
dropping SERVER altogther. If the server changes name, you don't have
to change the connection string. Then again, it is not unlikely that you
move the SQL Server to a separate box one day - in which case your
question becomes moot.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Connection String for "local" connection

I'm running MSSQL2k on a Win2k box used as a webserver. I imagine that
using a "localhost" type of connection would be faster than referring to the
server name and thus invoking the DNS lookup. The connection string I am
using as an ASP include is:
Dim Connect
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.open "DRIVER={SQL
Server};SERVER=SERVERName;DATABASE=DBnam
e;UID=USERid;PWD=Password;"
ThanksSomething even better would be to use OLEDB instead of ODBC. You can also
use (local) (with the parenthesis) instead of localhost to use named pipes
instead of TCP/IP but I'm not really sure is this will impact the
performance.
Replace localhost with 127.0.0.1 if you want to make really sure that the
DNS lookup has been shortcutted.
Finally, be default, the connections are pooled, so you shouldn't see any
improvement about shortcutting the DNS lookup.
S. L.
"MICHAEL SHIFFMAN" <mettaworks@.verizon.net> wrote in message
news:rSfAd.7050$1U6.2738@.trnddc09...
> I'm running MSSQL2k on a Win2k box used as a webserver. I imagine that
> using a "localhost" type of connection would be faster than referring to
> the server name and thus invoking the DNS lookup. The connection string I
> am using as an ASP include is:
> Dim Connect
> Set Connect = Server.CreateObject("ADODB.Connection")
> Connect.open "DRIVER={SQL
> Server};SERVER=SERVERName;DATABASE=DBnam
e;UID=USERid;PWD=Password;"
> Thanks
>|||MICHAEL SHIFFMAN (mettaworks@.verizon.net) writes:
> I'm running MSSQL2k on a Win2k box used as a webserver. I imagine that
> using a "localhost" type of connection would be faster than referring to
> the server name and thus invoking the DNS lookup. The connection string
> I am using as an ASP include is:
> Dim Connect
> Set Connect = Server.CreateObject("ADODB.Connection")
> Connect.open "DRIVER={SQL
> Server};SERVER=SERVERName;DATABASE=DBnam
e;UID=USERid;PWD=Password;"
To echo what Sylvain said: change DRIVER=(SQL Server) to Provider=SQLOLEDB.
Changing providers is not entirely painless - some things may broke. But
the default OLEDB-over-ODBC driver is deprecated for SQL Server, and since
it means one extra layer, there is definitely an extra overhead.
The gain in performance you may get by chaning the SERVER parameter is
probably neglible. However, as long as you run SQL Server on the web
server - which is dubious practice - you gain some maintainability by
dropping SERVER altogther. If the server changes name, you don't have
to change the connection string. Then again, it is not unlikely that you
move the SQL Server to a separate box one day - in which case your
question becomes moot.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp