The error message I finished last week with told me that the name pipes weren't working. That was still the case this week. It's irritating because I did the vanilla installation of everything and accepted the defaults. Honestly, I think that should guarantee success.
However, I have won this battle. I started reading the help to learn about this pipes business. It turns out that, by default, MSSQL listens on the pipe named\\.\pipe\sql\query unless you change it. But, the configuration program named the pipe \\.\pipe\MSSQL$SQLEXPRESS\sql\query Why? Because it's dumb. Also, I read about connection strings and, of course, they include the pipe name unless it's default. I figured that Visual Studio, since I have not told it anything about pipe names, would be trying to connect on the default. Solution: I renamed the pipe to be the default and, bingo, it works in Visual Studio. Now, what can I do with that connection? That battle is engaged.
UPDATE, 6/27/10: Doing this requires accessing:
Start->Microsoft SQL Server->Configuration TOols->SQL Server Configuration Manager
Then, in the left column click on
SQL Server 2005 Network Configuration->Protocols for MSSQLSERVER->properties
This will open a list of protocols in the right pane.
Double click on Named Pipes Properties and you will see a place to enter the Pipe Name (and enable it).
That's easy, right? I hate these people, even all these months later.
I start out by looking at the configuration manager. It's got a bunch of stuff I don't know what it is. I look at my book and it suggests SQL Server Management Studio Express. Cool. I go get it, install, and find that it has all kinds of stuff I don't about, too. Another tool available, though. After some browsing and thinking, I discover that VS (I can only type Visual Studio this one more time) has a thing in it's view menu called Server Explorer. I'm happy to say that it seems to see my account. There is an item called Data Connections. A right-click yields a menu that offers to Connect or, woo hoo!, Create a New Sql Server Database. It's easy to use and obvious as well, so I type type type and click go. It tells me that it can't connect to the database. I remember seeing somewhere that you need to turn on more access methods to use it from the web. My book explains that I need to use the Configuration Manager to turn on pipes and tcp. I do it and am confronted with the (perfectly reasonable) message that these won't take affect until the database server is restarted. A little google lets me know that the Management Studio is the tool for that. I hit my server, right-click and select restart. Access Denied!! I groan thinking of the trauma I had the other day with a similar message and IUSR. Google is my friend, though. The answer is that I need to run the program as an administrator. I have not clue how to do that but, google tells me that I can run anything as an administrator by right-clicking and choosing, get this: Run as Administrator. It's pretty much like sudo. If it needs to, it will ask for an admin password, and then run the program with uber-privilege. Done and Done. The server restarts. I head back to VS and try it out. I'm thinking, Oh Goodie! No dice. Still gives me the same error that comes down to the fact that it can't locate my sql server. I head back to the manager program to see if it will do anything other than restart and, yes, it will create a table and looks good. But, now it's time to get out of here because I can't stand it any more. I cannot for the life of me figure why a set of programs and services that are designed to work together don't. It's not like it's some sort of compromised environment. It's a fresh install of everything. As far as MSSQL goes, it's totally vanilla. I wish I could say it's a billion times easier on Linux or Mac, but it's not. However, they at least have the excuse that 1) nobody charges for LAMP, and 2) they are not written by a single company and sold as a turnkey solution. Arrrrgh. Still, it's fun. Peace.
1) Make a website. I think you can use something as simple as a folder with Default.aspx (containing regular html). Maybe there are other file types. That will be tomorrow's challenge.
2) Add IUSR to its permissions with Properties->Security->edit->add->enter object name->full permissions. UPDATE: it's a week or so later. I just added a new local host to my computer. It wouldn't work until I also added IIS_IUSRS. Apparently both are needed. 3) Go to IIS7 manager (control panel->administrative tools->IIS), click the outline in the left column until you see Sites. Right-click->Properties->add website. Enter things like I showed in the screen shot of the first post. 4) Edit C:\\system32\drivers\etc\hosts with Notepad in admin mode. Add a line like "127.0.0.1 www.sandbox.local" and save. It turns out that this is effective immediately. 5) Try the site. 6) Scream Eureka and make a cocktail. Accomplishment has been achieved.
I have been a LAMP (Linux, Apache, Mysql, PHP) programmer for a decade. I have a lot of habits and experience in those technologies. I'm also a Macintosh person and have been since 1984. I despise Microsoft.
I was looking for a job. I found one writing an application type of website. It's supposed to be a new platform based on the best technologies, preferring open source. I got the job by discussing OO and MVC and ORM and AJAX and LSB and a whole gibberish full of things that I had been studying while I was out of work. An incredible opportunity to do something extremely cool.Imagine my distress when I found that the new system is to be written using Microsoft technologies.
The opportunity is too good to refuse, or perhaps more accurately, chicken out of. Lots of people really like .NET. I'm sure there are lots of ways in which they are right. In any case, I'm going to do it and, by the end of 2010, I am going to be a serious .NET programmer.
I've been working here for about six weeks, mostly studying the problem domain and helping to write the proposal. I've done some studying on the platform components and will explain that later. I have spent today installing Parallels on my Macintosh and then Windows 7 in Parallels. And then Visual Studio in WIndows. Then IIS. Amazing how many details and how many hours it takes. Anyway, I was trying to figure out how to do virtual hosting so that I could have some sandboxes to play with in my new environment. After a bunch of frustrated googling, I found that IIS doesn't do virtual hosts. It does "host headers." Same idea. Different words. When I run into a situation where there is divergent terminology, I often think that it would be nice if someone used both terms in an article that google could propose to me. Then I realized, I am at the very beginning of an interesting experience that begs to be documented. And so, if I have the patience, this will become a repository of my learnings as I add .NET, C#, ASP.NET 3.5, ASP.NET MVC, ASP.NET AJAX, Sproutcore, nHibernate, Visual Studio, and heaven only knows what else to my brain box. I hope it's fun.