Note, I don't say it can't be done. It definitely can. I see it all the time in popup menus in Visual Studio. I type something that refers to "System.Web.UI.HtmlControls" and, poof, there's a menu that tells me all the options and what they mean.
Unfortunately, I am unable to do so with any form of reflection I have been able to devise. On top of all the stuff I did yesterday, I tried so many variations on the theme that I can't even remember them. No matter what, I could not convert the string "System.Web.UI.HtmlControls" into a list of methods, properties or anything else. I'm going to have to move on. I did take a little side trip into Javascript today. That was very fun. Familiar is nice.My next major task is to implement ASP.NET MVC and figure out how it works. However, I have come to understand that reflection is incredibly useful in figuring out how things work so I have digressed.
Constructor=Void .ctor(System.String)
Constructor=Void .ctor(System.Data.IDbConnection)
Constructor=Void .ctor(System.String, System.Data.Linq.Mapping.MappingSource)
Constructor=Void .ctor(System.Data.IDbConnection, System.Data.Linq.Mapping.MappingSource)
Method=System.Data.Linq.Table`1[roster] get_rosters()
Method=System.Data.Linq.Table`1[student] get_students()
Method=Void Dispose()
Method=System.Data.Common.DbConnection get_Connection()
... and another jillion more like them
Property=System.Data.Linq.Table`1[roster] rosters
Property=System.Data.Linq.Table`1[student] students
Property=System.Data.Common.DbConnection Connection
Property=System.Data.Common.DbTransaction Transaction
... and another jillion more
The new project does a lot of good things. Unfortunately, it didn't make it so that my website could connect to the database.
ALTER LOGIN sa WITH PASSWORD = 'VeryStrongPasswordHere'
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.