How to connect to database from IIS7 website

My environment: IIS7.5 on Win7, SQL Server 2008R2 on Win2008R2, VS2010, ASP.NET 4.0
My Scenario:
I have an intranet website running uder IIS. The site requires access to a SQL Server database on a different server.
The site Authentication has "Windows Authentication" and "ASP.Net Impersonation" enabled.
The site uses an Application Pool with ".NET Framework Version" = "v4.0", "Managed Pipeline Mode" = "Integrated" and "Identity" = "ApplicationPoolIdentity".
The database connection string is "Data Source=RSDXTST01.RESOLUTEENERGY.COM;Initial Catalog=ResoluteIntranet_Test;Trusted_Connection=yes".
My Issue:
When I inherited responsibility for this website there was a Sql Server Login "NT AUTHORITY\ANONYMOUS LOGON" with "public" and "sysadmin" server roles.  Our IT manager is uncomfortable with this login being in a sysadmin role. 
I can create a special domain user in Windows with appropriate permissions but how do I get IIS to attempt connecting to the database using this user instead of "NT AUTHORITY\ANONYMOUS LOGON"?

Having a SQL Server Login with sysadmin privileges is indeed a bit "crazy", to name it.
So you are on the right track when you create a simple Login with only access to the database in question and appropriate permissions on that.
You IIS Admin has to specify that user's credentials in the Connection String on the Web-Application. Make sure he uses windows-authentication. Otherwise he should at least encrypt that entry.
For moe details on those procedures you indeed may want to ask in a IIS/Webserver forum
Andreas Wolter | Microsoft Certified Master SQL Server
Blog: www.insidesql.org/blogs/andreaswolter
Web: www.andreas-wolter.com |
www.SarpedonQualityLab.com

Similar Messages

  • How to connect oracle database from tuxedo

    Hi,
    How to connect oracle database from tuxedo.
    If any one can help me.
    Regards,

    it depends on configuration your going to choose, there are two ways--
    - Using X/Open standards, for this
    you have to make an entry of Resource manager in $TUXDIR/udataobj/RM file.
    Then in UBBConfig file in GROUPS section u have to set Openinfo.
    It also depend on which database you are going to use.
    In your service now you need to call tpopen() API from tpsvrinit() function.
    - Other possibility is, take an implicit connection using Pro*C or Pro*Cobol whatever platform you are using.
    EXEC SQL Connect ...

  • How to connect informix database from informatica through JDBC instead of ODBC

    How to connect informix database from informatica through JDBC instead of ODBC.

    Hi mate,
    You may get fast reply for this in informatica forums.
    Thanks
    http://mkashu.blogspot.com

  • How to Connect Oracle database from excel

    I have installed oracle 11g on Windows 8 64 bit OS  on my laptop. I have Microsoft excel 2013. I can connect to database from SQL and from TOAD. Now  i want - from excel to connect to database.
    Please guide me the steps.
    Thanks

    Below link may be helpful to you :
    http://khalidali-oracledba.blogspot.in/2013/09/connection-between-ms-excel-to-oracle.html
    And if you are getting 32 bit vs 64 bit ODBC driver issue then :
    https://social.technet.microsoft.com/Forums/office/en-US/2234554e-e93c-438b-990a-6739df19da44/odbc-connection-problem-in-excel-2013-64-bit-windows-8-os-and-x64-processor-oracle-8i?forum=excel
    And still you are not able then post the question in :
    ODBC
    Regards
    Girish Sharma

  • How to connect the database from one ip to another ip pc.?

    hai,
    iam new to the obiee. i have the database in the ip : 198.0.0.0(for ex) and i have to connect that through the odbc to my pc ip: 198.0.0.1 (for ex). plz explain how we can connect to the other database from our pc to import that database to our administrator tool in bi.
    thanks in advance,

    hi...
    install client software in your machine
    perform, listener configuration using net configuration assistant,
    Now using this listener name, you create a DSN and use it in rpd,, you want to develope
    OR
    go to ODBC Data Source & Administrator and add DSN with Microsoft ODBC for Oracle
    in server field, you write your parent machine\listenername
    and use this in rpd... i hope the second one works out...

  • How to connect Oracle database from Active Server page

    Hi
    This is srinivas aluri
    I have developed an application using ASP and MS-SQL7.
    Now i want to port this application to Oracle 8i database
    I have written my connection in seperate file called
    connection.inc using SQL OLEDB provider
    If i have to connect oracle database what will be my provider
    and what is the exact code for this connection string
    Here i am giving the code of SQL databse connection string
    strcon= Provider=SQLOLEDB.1;Persist Security Info=False;User
    ID=sa;Initial Catalog=prjdb;Data Source=servername
    i have tried by changing the provider name from SQLOLEDB.1 to
    OraOLEDB.oracle
    but i could not able connect the database.
    It is giving provider not found or not properly installed error.
    But the same code is perfectly working from Visual Basic code.

    it depends on configuration your going to choose, there are two ways--
    - Using X/Open standards, for this
    you have to make an entry of Resource manager in $TUXDIR/udataobj/RM file.
    Then in UBBConfig file in GROUPS section u have to set Openinfo.
    It also depend on which database you are going to use.
    In your service now you need to call tpopen() API from tpsvrinit() function.
    - Other possibility is, take an implicit connection using Pro*C or Pro*Cobol whatever platform you are using.
    EXEC SQL Connect ...

  • How to connect oracle database from solaris platform

    I have installed oracle9i client on solaris8, how can I configure to connect other oracle database?
    thanks for your assistance!!

    If the database is remote you would need to setup a sqlnet.ora and a tnsnames.ora file. Their locations are platform dependent. On AIX the files are in /etc while on some platforms you find the files in /var/opt/oracle and on others $ORACLE_HOME/network/admin. We have a Sun Sparc running SunOS 5.6 that has them in /var/opt/oracle.
    Configuation can be done through the installer as part of the install process, probably using a gui tool, or manually. We vote for manually.
    See your install README files and the ORANET manuals for details. Or once you know where the files belong copy them from a platform that can access the db you want to reach and just remove unnecessary lines for other databases.
    HTH -- Mark D Powell --

  • How to connect external database(Ex:SQL Server/Tivoli)  from ABAP Webdynpro

    Hi,
    Any one have idea how to connect external database like SQL Server/Tivoli to access tables from WebDynPro ABAP.
    Please point to me some links if you have
    Thanks
    Praveen

    Hi,
    Please check out this link -
    FETCH DATA FROM ORACLE DATABASE USING Web Dynpro
    Regards,
    Lekha.

  • Problem in connecting to database from webdynpro for java

    Hi
    I have a problem in connecting to database from webdynpro application
    I am using oracle 10 express edition as database and was able to connect to database from a java application.But  was unable to connect from a webdynpro for java.
    <b>I guess webdynpro for java uses open sql instead of vendor sql(I looked in the visual admin ,DB is using open sql) so unable to connect to database.Am i right.?</b>
    Do i need to make any settings in the visual admin to make it work?
    How to solve this problem.Please give me pointers
    Thanks
    Bala

    Hi,
    For connecting to Oracle, either you can use the normal JDBC connectivty code directly which is given below :
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("your query");
    In case you want to fetch data through ejbs, these are the steps to be followed :
    1) Open the J2EE perspective
    2) Create an EJB Module project
    3) Right click on ejbModule, create a new EJB (select your EJB type)
    4) While creating the ejb itself, you can add business methods by clicking ‘Next’ in the UI. Another option is after creating the ejb, write the method in the bean, then select the method from ejb-jar.xml -> <bean name> ->method. Right click and select ‘propogate to local & remote’.
    5) Double click on ejb-j2ee-engine.xml. select your bean and specify a Jndi name for eg: “MyJndi”.
    6) Right click on the EJB project and add ‘classes12.zip’ file (provided by Oracle) to it’s build path. (under libraries tab). Also check the same file under ‘Order & Export’.
    7) Create an Enterprise Application project.
    8) Right click on the EJB module project and select add to EAR project, then select the created EAR project.
    9) Right click on the EJB project, select ‘Build EJB Archive’
    10) Right click on the EAR project, select ‘Build Application Archive’
    11) Open the WebDynpro perspective, open a new project, right click on the project ->properties. Do the following configurations :-
    • Java Build path - select the EJB project from ‘projects’ , check the selected project under ‘Order & Export’
    • Project references – select the EAR project
    • WebDynpro references – select ‘sharing references’ tab, click add & make an entry as : <vendor>/<EAR project name without .ear extension>
    You can find the vendor name under ‘application-j2ee-engine.xml’ file of the EAR project. By default it is ‘sap.com’. So if my EAR project’s name is ABC, my entry would look like ‘sap.com/ABC’
    12) Now the configurations are over and the EJB can be invoked by writing the client code inside the webdynpro component. Like:
    InitialContext context = new InitialContext();
    Object obj = context.lookup("MyJndi");
    MyEJBHome home = MyEJBHome)PortableRemoteObject.narrow(obj,MyEJBHome.class);
    MyEJB mybean = home.create();
    int a = 0;
    a= mybean.add(10,15);
    wdContext.currentContextElement().setSum(a);
    where ‘MyEJB’ is my EJB name and ‘MyJndi’ is my JNDI name
    To connect to Oracle , you can write the usual Java code (given below) as a business methos of the ejb (similar to add() method in the example). And access it like mybean.<businessMethodName>().
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("your query");
    Extracted from Re: Webdynpro and Oracle
    http://help.sap.com/saphelp_webas630/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm
    May be of use to understand the VA Conf /people/varadharajan.krishnasamy/blog/2007/02/27/configuring-jdbc-connector-service-to-perform-database-lookups
    Regards
    Ayyapparaj

  • How to connect mysql database using xml

    welcome to all,
    here my doubt is how to connect mysql database using xml file, how to integrate xml file and jsp file and how to access data from dabase using jsp file. can any one help me
    regards

    Short answer: you wouldn't do any of those things. The first two are meaningless and the third is a bad practice. I have no idea what those ideas were supposed to achieve so I have no idea what tutorials I should suggest to you.

  • How to connect to database in JSP

    Hi, all.
    I am using J2EE and cloudscape. I have written all the EJB classes. But now i have no idea that how to connect to database in jsp such as i get user ID from portal, then i connect to database check the existence of user ID and the password then return true or false value. how to write all this in jsp?
    Thanks very much!
    yayun

    this is the required code
    i hope this will help u
    <html>
    <head>
    </head>
    <body>
    <%@ page import="java.sql.*" %>
    <%
    try
    String fu=request.getParameter("username");
    String fp=request.getParameter("password");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection Con=DriverManager.getConnection("jdbc:odbc:wind","","");
    Statement stmt=Con.createStatement();
    ResultSet rs=stmt.executeQuery("select * from table1 where username='"+fu+"' and password='"+fp+"'");
    if(rs.next())
    %>
    <jsp:forward page="success.jsp"/>
    <%
    else{
    %>
    <jsp:forward page="unsuccess.jsp"/>
    <%
    catch(Exception e)
    %>
    </body>
    </html>

  • How to connect DB2 database to Xcelsius

    Hi,
    I am looking out for options to connect my DB2 database to xclesius. I dont want to go for BOBJ licensing cost. Do we have some other way to achieve this?
    Thanks,
    Neha

    Check out the below links:
    How to connect to DB2 from xcelsius without the presence of BO environment
    https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=8&cad=rja&uact=8&ved=0CFEQFjAH&url=http%3A%2F%2Fwww.busi…
    Page no 7 has explained how to connect DB2 using the data access driver.
    --SumanT

  • How  to  connect  to  database

    Hi Experts,
    i am using oracle 10g (10.2),linux4.6 .my databae server contain multiple databases how can connect one database to another database and how can i put this all environment variable in single parameter file

    tmadugula wrote:
    Hi Experts,
    i am using oracle 10g (10.2),linux4.6 .my databae server contain multiple databases how can connect one database to another database and how can i put this all environment variable in single parameter fileYou can see from the responses two very different sets of advice. To know what applies to your situation, you need to clarify what you need to do.
    If you are talking about choosing which database you connect to from sqlplus, follow the advice about changing the environment variable ORACLE_SID.
    If you are talking about having one database being able to access another (one db acts as the client to another) follow the advice about db links.

  • How to connect to db from sql navigator ?

    database active and working.
    login from web working normally.
    how to connect to db from sql navigator ?

    Remote connections generally need three bits of information, whether its an oracle, odbc, or some other type of client ...
    1. Where does the database "live" (hostname or IP address)
    2. What port is the database listener "listening" on for connections
    3. What is the database service name or $ORACLE_SID
    Default port is 1521, if its an XE install the service name is XE out-of-the-box (as set up by the installer and no DBA intervention.)

  • How to move SQL database from one location to another location i.e. from C' drive to D' drive

    Hi, How to move SQL database from one location to another location i.e. from C' drive to D' drive ? please share some link.
    Thanks and Regards, Rangnath Mali

    Hi Rangnath,
    According to your description, my understanding is that you want to move databased from C drive to D drive.
    You can detach Database so that the files become independent, cut and paste the files from source to destination and attach again.
    There are two similar posts for your reference:
    http://mssqltalks.wordpress.com/2013/02/28/how-to-move-database-files-from-one-drive-to-another-or-from-one-location-to-another-in-sql-server/
    http://stackoverflow.com/questions/6584938/move-sql-server-2008-database-files-to-a-new-folder-location
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

Maybe you are looking for

  • HT2513 how do get to view the year in ical?

    I have ical on my MacOsX version 10.6.8.  New at using ical, however I'm wanting to view the year and it will only let me view, day,week,month!  help???

  • Can not access V$Mystat sys view from procedure.

    Hi All, I am facing a problem like explained below. Please suggest me what to do.      I hav a cursor to access Distinct sid as follows : Cursor Cur_Sid Is      Select Distinct Sid From V$Mystat; If I try to use it from a procedure it throws error li

  • Creative vision M: not charging, not even through wall socket.

    I had my vision M for some time now, but it as not been used for around a year now. The other day, i wanted to use it, i plug it in the wall, came back a few hours later it had not charged at all. I could scroll through my music, but the battery was

  • I need Patchset to upgrade from 11.1.0.6 to 11.2.0

    I need patch set to upgrade 11.1.0.6 and which patch set is available to upgrade from 11.1.0.6 to 11.2.0.1 or 11.2.0.2 Please suggest . Thanks Edited by: 845470 on Jul 23, 2012 4:00 AM

  • Cannot see rescue e-mail change option in my Apple ID account

    I want to change my Apple ID e-mail address due to the loss of my old e-mail. However my current e-mail address is set as my rescure e-mail address but I cannot see how to remove it in my Apple ID editing area. So I need to, 1. Remove my rescue addre