I've got web application created for MSSQL and IIS. There are two directories in this application - Scripts and WebSite. In Script there is file CreateDb.sql. I need to run it so that it can create database. I changed in that file one line into this:
CREATE DATABASE [NameOfDb] ON PRIMARY ( NAME = N'NameOfDb', FILENAME = N'F:\Inetpub\wwwroot\htdocs\WebSite\NameOfDb.mdf'
and the other part for the same directory but other filename (NameOfDb.ldf). I store the file CreateDb.sql in the directory F:\Dane\NameOfProj\Scripts. I copied WebSite directory here F:\Inetpub\wwwroot\htdocs\WebSite.
:: MSSQL ::
I installed Microsoft SQL Server 2008 and run in Command Prompt:
C:\Documents and Settings\useruser>osql -Usa -Ppassword -i "F:\Data\MyApplication\Scripts\CreateDb.sql"
[SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server .
[SQL Server Native Client 10.0]Login timeout expired
[SQL Server Native Client 10.0]A network-related or instance-specific error has occured while establishing a connection to SQL Server. Server is not found of not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
I found this http://www.mydigitallife.info/2007/10/31/error-has-occurred-while-establishing-a-connection-to-sql-server-2005-which-does-not-allow-local-and-remote-connections/ but it is for Microsoft SQL Server 2005. I don't have any SQL Server Surface Area Configuration in Configuration Tools. How to get rid of that SQL Server Native Client 10.0 error?
:: IIS ::
I entered "control Panel" -> "Administrative Tools" -> "Internet Information Services", pressed right mouse button on "Web Sites" but I couldn't find any "Add Site", in the menu "File" neither.
So I entered directory F:\Inetpub\wwwroot\htdocs and copied WebSite to this directory (as mentioned at the beginning of this post). The problem is that the main file is not "index.html" but "Default.aspx".
I also run in Internet Explorer address 127.0.0.1. It asks me about user name and password, I enter it correctly. But then I see "The page cannot be displayed". Maybe IIS is not properly run? How to run IIS properly?
It is written in pdf documentation of this web application that I need to "create on Internet Information Services 6.0/7.0 web application. Assign application pool to the application, it is recommended for the application to have its own application pool". Maybe it is the reason that it doesn't work? How to create this application pool properly?