Start SQL Server from Command Line
I run a Virtual PC with Vista 32-bit as Guest operating system for my software development purposes. This VPC is quite slow despite taking measures to shut down various background services.
For reasons beyond my understanding (and me not willing to investigate on it), whenever a MMC console window is opened, CPU usage spikes to 100%. It was frustrating to to start SQL Server Engine by going to the services.msc console. So, I found a way to start SQL Server service from command line.
Please click on above image to see the command in clarity.
LINQ-SQL Nuggeting
On my recent project, I had to help my co-developer get an understanding of LINQ-SQL (Yes, I am aware that LINQ-SQL has been shelved by M$).
I remembered the brilliant MSDN Nuggets that were produced by the evangelist teams here in Microsoft UK. These were helpful short videos organised by tags based on technology/interests. They are even now hosted in MSDN UK web site. But, they have a search facility instead of the earlier tags/categories. I generally don't lend myself to searching on MSDN despite it insisting "live search" with green coloured attractions. So, felt a bit disappointed at the difficulty in locating nuggets for a specific technology/interest.
I just opted to view all the nuggets by Mike Taulty. Eventually picked up the list of nuggets for LINQ-SQL that might be of immediate help to my co-developer.
- Introduction to LINQ-SQL
-
Understanding Data Context
-
Mapping Schemas to Classes
-
Inserting data
-
Deleting
-
Updating
-
Joins with LINQ-SQL
-
Working with NULLs
- Understanding When queries execute
-
Deferred loading of related entities
-
Querying wth Stored procs
-
Updating with Stored Procs
- Transactions
Hope that helps my friend to get up to speed with this project.
Tapovanam - application design and architecture
In redesigning and redeveloping Tapovanam's (my friend's organisation) web site, I want to put in place a good architecture. The following are some of the considerations:
- A multi-tier design (mainly to separate presentation code from business logic)
- Support themes in presentation layer to switch designs easily at later stage.
- Object oriented business logic layer (BLL) (with business objects)
- Data access layer (DAL) to be independent of underlying database (to switch databases or even use XML files as data store at a later time)
- Data Transfer Objects (DTO) to pass data between BLL and DAL
- Maximum use of Data Binding at the presentation layer
Web client software factory - Hands-on-lab
Having decided on giving the WCSF a try, I had a pretty smooth experience with installing WCSF.
The February-2008 release of WCSF does not use the Enterprise Library 4.0. It uses Enterprise Library 3.1. Although, the EntLib 3.1 is sufficient for WCSF-Feb'08, it just feels good to have and build upon the latest version. It took a few careful steps to get the WCSF working with EntLib 4.0. And even after that, at times, the guidance packages generate code that still uses EntLib3.1. This is not a major problem because I was able to re-reference the projects to the latest EntLib 4.0 assemblies.
The foremost concept to understand is the Modular structuring of the Web Application.
Then comes the understanding of Model-View-Presenter pattern. It took a while for me to figure out the role of Controller.
There is also the concept of a Service that gets consumed by a Controller. This Service has nothing to do with Web Services.
In fact, there is much more fundamentals to understand than I could discover in the hands-on-lab sessions.
The best resource (and by far the best writing) to explain concepts related to WCSF is Simon Ince's blog series. His posts made me understand the purpose of WCSF and have also inspired me on the various architectural considerations.
Excluding vwd.webinfo from adding to VSS from VS 2005
When I have a ASP.NET WebSite (NOT WebApplication), I notice the presense of vwd.webinfo in my VS 2005 solution. The problem is the annoyance when it shows as a new source control item. (with a plus sign next to the filename). So, when ever I do a “Pending Checkins”/“Checkin”, it is included as part of the pending items.
At the moment I am taking care to uncheck this file and then do the checkin.
But, it would be nice to have tell VSS to exclude this file (or set of files) from trying to add to VSS.
I’ve also thought about “exclude from this project” option in Solution Explorer within VS 2005, but then it adds a file called vwd.webinfo.exclude and then this shows up in pending checkins once again.
Using the VSS client, there is a facility to include FileTypes. To my surprise, the *.webinfo was not included but still the VS 2005’s VSS plug-in tries to add it.
I’ve never managed to get an solution to this problem yet. Hopefully something might turn out at a later time.
Learning to Program the Ruby way
Well, it should not to be mentioned under this blogspace. Nevertheless, for the fun sake of it, I started to learn computer programming (now that it’s been nearly 8 years since I wrote my first proper computer program using C ). A friend of mine introduced me to a book he was having as a gift to his dad (who is starting to program). This book is titled ‘Learn to Program’ and it should be sufficient to say that it belongs to the ‘Pragmatic Series’ from the Pragmatic Programmers.
The book is amazingly interactive. I laughed and smiled while learning to program using this book. The author has done a commendable job in writing this book in such an lucid manner.
And what can I tell about Ruby? From One-Click Download and Installation upto using the SciTE editor, everything was simple and neat. Not a single problem. The language is also very very light in appearance and does a good job. I am loving it every day. Looks like after a long time, the need for learning a language for fun has really brought some fruit. Ruby is fun. No doubt! I don’t have current plans to use it for my projects. But, I may consider it to create website using the Ruby On Rails MVC Web Framework.
From VSS to CVS; From CVS to SVN
Hmm…..After VSS came CVS and now after CVS it’s time to try out SVN!
Yesterday, I was finally determined to make my machine a build system(with WinXP SP2 Pro) for which I had to install and configure CruiseControl.NET. For which I had to install VSS. Then I thought of CVS (because, I was comfortable with CVS way of doing things for the past 1 year). Oh…then I thought of SVN (because, SVN is to be a compelling replacement for CVS).
The best part of SVN is the availability of the free e-book which is quite exhaustive. I was indeed more happy to read the TortoiseSVN e-book because it gave detailed steps to install the SVN Server and not just the TortoiseSVN Client.
Since I did not have Apache Web Server in my system, I prefered the SVNServe type of SVN Server which listens on port 3690. With that I had my svn server setup but before running the server, I read a piece of information in the book which said that the svnserve.exe can be run as a windows service using a wrapper called SVNService. Without much thought, I tried running the svnserve as windows service.
But, to my despair when I tried to view the repository which I had just created using TortoiseSVN, I could not find the repository using the repo-browser of TortoiseSVN. Something has gone wrong somewhere….After 30 minutes, I started to suspect the SVNService wrapper. So, instead of going to that level of abstraction, I decided to run the svnserve manually using command prompt. And lo there was Windows XP SP2 in action asking my permission to unblock the port 3690. Phew! that was a relief. After unblocking it, I reverted back to SVNService.
There ended my initial adventure with SVN which was quite less exciting than my earlier ones with CVS and TortoiseCVS. I am expecting the real thrill when I start using ASP.NET application with SVN.
A Virtual Day with Virtual PC 2004
Today was a day dedicated to Virtual PC 2004.
My colleague (infact classmate) Ankur was the first one to have installed Virtual PC 2004 and have it up and running. His setup was quite surprising. He was able to install Virtual PC 2004 on a Windows XP Home edition. His one and only GUEST machine was Windows Server 2003. Infact, Virtual PC 2004 does not officially support this setup. Ankur’s need was quite different than mine. Since he had a laptop and a desktop computer he could afford for that kind of setup wherein he would be using the Windows Server 2003 for SQL Server 2000 and Source Control.
Since I don’t have the comfort of having a separate physical server, I wanted to install Windows Server 2003 as my GUEST machine with the HOST being a Windows XP Professional. The idea was to create a Virtual Network with the HOST and GUEST being the only nodes in the network. The excellent help provided by Virtual PC 2004 was useful only to get started.
I had to first install the new network adapter(Microsoft Loopback Adapter) using Add Hardware Wizard on my HOST machine and provide the HOST with a static IP address (192.168.1.1) for the connection associated with LoopBack Adapter. The similar proceedure was followed in my GUEST machine with the IP address being 192.168.1.2. I also changed the number of network adapters for the GUEST machine in the Virtual PC Console to include the Microsoft Loopback Adapter.
I restarted my GUEST machine and expected my HOST to detect the GUEST.
That looked like a distant future for me. Basically I could not get it to work. On googling, I found a link to a Virtual PC guy’s blog which explains a subtle problem. A chicken and egg kind of problem is what he says. Oh…and here is the actual Virtual PC guy’s blog. Now then I had to realize it will take quite more strain to make this thing work or conclude that it will NOT work. At this point I give up for the day and go to reality by taking a nap and iterating on this stuff tomorrow……..
LINKS:
My first experiments with NUnit and NAnt!
Finally I got a chance to use these tools (NAnt and NUnit)
The first to be used was NUnit 2.2 and had problems using it because I don’t have permissions to install any assemblies into the .NET 1.1 Global Assembly Cache. So, I had to obtain the source and did the manual installation of copying all the required assemblies into a single folder. Then I set up the Path Environment variable to include path where these assemblies were put.
After doing this I went cruising my way creating cool unit tests for my own library under construction. It all worked fine and I used the NUnit-GUI to test my applications.
Back to formal education
Oh…it is a awesome feeling to go back to school to study.
I am now enjoying what I had been waiting for nearly 1 year. I am devoting my full time to books and that too on .NET books which makes me feel good.
But, it is not easy to go back to full time study after working in the industry. The contrast is in the case of university, we tend to be very consious about what we are learning. In the industry the learning process is overall and not in depth. So, learning during working is remembered more than the learning at university. I could realize this during my first week of my classes in The University of Hull where I am in the .NET MSc in Distributed Systems Development course. I came to know about this course through a blog post which i am not managing to trace back. And now, I am just doing the kind of stuff I’ve wanting to do in the past. Some cool low level compiler stuff upto using xml web services.
Why not read a book for your collegues!
I have now originally copied an idea from Rick. The idea is on how to make myself read a book. Rick started by writing out snippets (in his own words) from a book he was reading. Not just writing it for himself, he was sending them as mails to the collegues.
It so happened that for sometime such mails stopped which prompted me to mail him to ask about the proceedings. He said he shall continue doing it. Which makes him read the book.
I have also started to do something like that now. I am reading the “Essential .NET - The CLR” by Don Box. And not just that. In our internal forum, a new forum has been dedicated to this purpose. (email becomes cumbersome due to maintainance problems).
Advantages:
- I get to read the book as collegues expect something every day.
- I also get to summarize what I have read (best method to retain knowledge is to share it).
- Collegues also get to read the book at a glance.
A different advantage of multi-language support in .NET
The reason I chose today as the day for this is that I could see someone starting to go ahead with the project development like some student hacking his way around. I have lost the patience to even look at such kind of coding. Worst is the case when there are files named “WebForm1.aspx” and “WebApplication1.sln”. If not today then never it will be. If substantial amount of coding goes into the project then the natural tendency to resist change occurs and the result is spaghetti code. ( ”Denial is the most predictable of all human responses” - from Matrix - http://www.neoandtrinity.net/)
Training the non-techies on .NET!
“What should you start with and where to stop?”
These were just a couple of challenges I had to face this week at the training program organized at my workplace for the freshmen who joined our team a couple of weeks back.
The challenge becomes more interesting when the group consists of few computer science graduates and few non-computer science graduates.
My First Ever Talk for the Academia
I had never expected such an event to happen at Christ College. Always wanted to be part of this beautiful campus as a student. Great college with great people around.
Initially, did not know what to talk on. Had no idea about how much the academia is updated with .NET. So, decided to present a very basic talk. The intension was to instill the basics. Clarify all the jargons surrounding .NET technology. Also to give a clear picture on how the various components of .NET fit into the development infrastructure.
Height of .NETing! (1892 meters Above Mean Sea Level)
It was just 3 months since the escape to the jungles, the nature invited another visit to the peaks, valleys, jungles, water falls, wild. The timing was not very perfect as my presence would have really helped the team to go ahead with the product release smoothly. Despite the tight schedule, made myself way out of this noisy Bangalore to the bliss of the Western Ghats.
This trek was to the KudreMukh (The peak that looks like the Face of a Horse) in the Western Ghats of Karnataka.
The arrival of Microsoft VS Team System
It makes me awe at the pace with which Microsoft is introducing new products. Added to that list is Microsoft VS Team System. Just the kind of product we wanted.
Got to appreciate the way this product was released. No clue about it till the last minute of announcement. Being a avid reader of the blogs, not many gave any clue about such a product. (or, have there been news about it? Not to my knowledge!)
While the attention was diverted in the blogs about new features in existing products (Office and Whidbey) or about features in some distant product (Longhorn), a silent product was under development with tight lips.
Now, is Microsoft creating a pattern for the usage of blogs. “Use blogs mostly for gaining/providing insights into distant/existing products”
This becomes evident as a blog being created immediately for VS Team System!
Any case, good going!
Lots of stuff ahead in 2005.
Finally, A Good Bye to Visual SourceSafe!
In my previous post on “Using CVS with VS.NET”, I’ve discussed the need to switch to CVS and also the problems faced in doing so.
After long time (nearly 2 months) my team has finally become very comfortable with using CVS and VS.NET. Looking back 2 months from today, I get reminded of those days when a whole day would be spent by me wondering who did what and what went wrong. With good push from my team-mate, Jimson, CVS was finally chosen as our Source Control. We did find a good plug-in called “Push-Ok” for VS.NET 2003. An excellent plug-in I should say. But, it came for a price.
We chose to stick on to Tortoise CVS and take the hard way around. We found that apart from files being edited by us, the VS.NET IDE also changed some files (like .csproj). Then with the help of Jimson, found out the right files to got into the CVS repository. Thus, after a half day session for the team on how to use “CVS with VS.NET” things got settled and now everyone seems to be comfortable with the “Copy-Modify-Merge” way of doing things.
A great feeling and a great relief….
Good going team…..
Working with ASP.NET UI Designer!
First, the controls could not be compacted within each cell of the table.
Second, confused whether to use the HTML view of Design view to create the pages.
Basic Integrated App using UIPAB and Forms Authentication
Just yesterday afternoon, when I thought of having a difficult weekend to crack the problem with UIPAB, lightning struck. I got a reply to my question posted to news.microsoft.public.dotnet.distributed_apps redirecting me to GotDotNET workspace where a fix to the Back button problem with UIPAB was posted. God, that was timing. Had the reply come at sometime evening, I would have been spending my entire day today searching for alternatives for UIPAB (specifically Maverick) and working on it. ( I think i’ll take some time off and try Maverick some time before UIPAB v 2.0 release).
As such, the Fix for Back button problem ( http://groups.msn.com/BDotNet/general.msnw?action=get_message&mview=0&ID_Message=12337&LastModified=4675459353602606026 for a description on the problem) did infact work out very well. I guess, the fix has been taken care in UIPAB v2.0.
With this fix, I managed to complete a Demo application integrating UIPAB and Forms Authentication yesterday evening.
The demo application will be used in my presentation on Monday to share my knowledge on UIPAB and Forms Authentication to my collegues.
Currently trying to use Data Access Applicaton Block in my demo application.
Also listening to DonBox’s .NET Rocks Internet Audio Show (talking about Indigo,SOAP…..)
My Kata - Forms Authentication
Today’s task of the day was to enjoy. So, the Kata was to experiment with Forms Authentication.
It has taken nearly a week to understand the Security Issues related with the ASP.NET application. Finally got a hang on Roles, Users,IPrinciple,Encryption and all other simple matters related to security.
The best part of today’s Kata was that it got over is just 60 minutes (The last 60 minutes of the day).
Two more kata’s are pending. One is to integrate the previous kata on Storing Encrypted passwords in Database with today’s kata. The second is to integrate the resulting kata with User Interface Process Application Block.
Off to meet a friend and discuss C# Types.