I got myself some .NET hosting today, simply because I want to do a few projects and I prefer C# and .NET. So I registered a domain, www.fremus.net and I will be getting stuck into a few ideas I have. .NET Hosting in my home country, South Africa, really sucks, there is no other word for it. We just do not match up.
Archive for July, 2009
Making decisions, and carefully considering them
Windows Communication Foundation versus older web services (.asmx) is a question that really bugged me today. Why? Because I was merrily developing an application using a SOAP Client and asmx files, and I stopped mid-flight, thinking to myself am I doing the right thing? Should I be adjusting my approach? So I set about Googling on the topic and came across several resources or opinions, but one thing that did stand out for me was that WCF web service do not need to be attached to IIS to work. Normal (dare I say legacy) web services (asmx) only use HTTP and therefore can only be run if its attached to a process that can run HTTP. WCF is not so limited, in fact it supports multiple protocols. WCF is an ‘umbrella’ technology that encompasses several other technologies. Decision was made, I will not easily use older web services again if I don’t have too.
What a sigh of relief
Ok so I have written my first CLR project, but there are a few things I didnt do right and which I know requires a bit more knowledge and effort. Firstly, the context-connection seems to be only applicable to the SqlPipe class. I tried using an SqlConnection that used a regular connection string, but I got an error stating that SqlPipe.Context can only be used with context-connection = true. Allrighty then. Coming to think of it I did not do much wrong in terms of data access, because I used stored procedures that already existed. Anyway…
My main problem was that I needed a connection string and I didnt know how to get it. To get a connection string into a CLR project you have these choices:
- Use an App.config file. This is not really recommended in a production environment because you will have to restart SQL Services for SQL Server to read the values in the config file. If you plan on using a config file, you will have to place the config file in the root folder of the SQL server instance. You get this by looking at the properties of the database (look for Root folder), and naming the file something like sqlsrv.exe.config.
- Hardcode the connection strings. This is hardly a good thing to do
- Use context connection = true. Again though you need to be aware that the usage for this connection type differs from a regular connection string. Read the MSDN article here
- Use some external file, plain text, xml, etc. This means however knowing a part of the directory structure the machine/server resides on.
- Could you use a web service? Haven’t really thought this one through yet. But could you hypothetically speaking use a web service to initialise a connection string? I’m not sure
- Use a scalar user defined function and pass the database details as parameters, and run the function as a Job. This is the method I chose.
Pages
Archives
- November 2011 (5)
- August 2011 (1)
- July 2011 (1)
- June 2011 (3)
- May 2011 (1)
- April 2011 (11)
- March 2011 (3)
- February 2011 (5)
- January 2011 (6)
- December 2010 (2)
- November 2010 (3)
- October 2010 (2)
- September 2010 (5)
- August 2010 (4)
- July 2010 (3)
- June 2010 (7)
- May 2010 (1)
- April 2010 (6)
- March 2010 (2)
- February 2010 (1)
- January 2010 (1)
- December 2009 (2)
- November 2009 (5)
- October 2009 (26)
- September 2009 (15)
- August 2009 (2)
- July 2009 (3)
- June 2009 (1)
- May 2009 (1)
- April 2009 (3)
- March 2009 (2)
- February 2009 (3)
- January 2009 (11)
- December 2008 (13)
- November 2008 (8)
- October 2008 (10)
- September 2008 (9)
- August 2008 (13)
- July 2008 (12)
- June 2008 (9)
- May 2008 (8)
- April 2008 (6)
Categories
- 2011 (1)
- AJAX (14)
- Application Development (23)
- ASP.NET (28)
- ASP.NET MVC (8)
- Bing (1)
- Blog Action Day (1)
- Browsers (5)
- C# (62)
- Chrome (1)
- Content Management Systems (1)
- Design Patterns (1)
- DevDays (1)
- eMarketing (6)
- Facebook (4)
- Firefox (3)
- Fremus.co.za (8)
- General (48)
- Google Chrome (1)
- Information Technology (1)
- Internet Explorer (2)
- jQuery (4)
- Leadership (2)
- LINQ to XML (4)
- Microsoft (1)
- Microsoft Events (1)
- Music (1)
- News (2)
- PC Hardware (1)
- Personal (16)
- Photography (1)
- SEO (3)
- Silverlight (11)
- Software (1)
- Springboks (1)
- SQL Server 2005 (7)
- SQL Server 2008 (3)
- tech (2)
- TranceFamily (1)
- TV Series (1)
- Twitter (1)
- WCF (1)
- Web 2.0 (13)
- Web Design (9)
- Web Development (36)
- Web Search (1)
- Web Technologies (39)
- Windows Phone 7 (2)
- Windows Powershell 2.0 (1)
- Wordpress (6)
- WPF (2)
Tags
.NET Adobe Flash AJAX Armin van Buuren ASP.NET ASP.NET MVC C# concept context CSS e-Marketing Facebook Firefox 3 Fremus General Thoughts GMail Google Google Analytics Javascript jquery LINQ to XML LiveValidation Microsoft Microsoft Access Microsoft Powerpoint object-oriented Personal PHP Programming ScrewTurn wiki Silverlight Social Media Social Networking South African E-Marketing SQL Server 2005 Twitter Visual Studio 2008 WCF web-based solutions Web 2.0 Web Design web development wiki's Wordpress WPF