<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9080249931157151820</id><updated>2011-11-27T15:59:57.252-08:00</updated><category term='C#'/><category term='close'/><category term='Hardware'/><category term='technology'/><category term='proxy'/><category term='.NET Dev'/><category term='silverlight'/><category term='Financial Crisis'/><category term='Access Connection String GoDaddy'/><category term='about me'/><title type='text'>C# Solutions .NET</title><subtitle type='html'>Programming, C#, VB .NET, ASP .NET, Software, Web Development, Information Technology</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-3965567800005804500</id><published>2010-01-04T09:42:00.000-08:00</published><updated>2010-01-04T09:44:46.054-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='close'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy'/><title type='text'>Silverlight WCF Proxy Close</title><content type='html'>Hi, I just wanted to let you all know that I believe it is advantageous to close your proxies when leaving a silverlight page. The best way, I believe, is to do this in the class destructor.&lt;br /&gt;&lt;br /&gt;        ~MainPage()&lt;br /&gt;        {&lt;br /&gt;            if (proxy != null)&lt;br /&gt;            {&lt;br /&gt;                proxy.CloseAsync();&lt;br /&gt;                proxy = null;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;Hope this helps someone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-3965567800005804500?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/3965567800005804500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=3965567800005804500' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/3965567800005804500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/3965567800005804500'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2010/01/silverlight-wcf-proxy-close.html' title='Silverlight WCF Proxy Close'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-1020265185244258471</id><published>2009-12-14T12:40:00.000-08:00</published><updated>2009-12-14T12:46:11.999-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Access Connection String GoDaddy'/><title type='text'>How to Access an Access Database from GoDaddy</title><content type='html'>Here's a way I found useful for accessing an access database in code from GoDaddy, Hope it helps someone.&lt;br /&gt;&lt;br /&gt;First Include:&lt;br /&gt;System.Web&lt;br /&gt;&lt;br /&gt;        private static string GetConnectionString()&lt;br /&gt;        {&lt;br /&gt;            HttpContext serverContext = System.Web.HttpContext.Current;&lt;br /&gt;&lt;br /&gt;            string db_path = string.Empty;&lt;br /&gt;            string db_dir = serverContext.Server.MapPath("access_db") + "\\";&lt;br /&gt;            db_path = db_dir + "Crossroads.mdb";&lt;br /&gt;            string connectstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + db_path;&lt;br /&gt;            return connectstr;&lt;br /&gt;        }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-1020265185244258471?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/1020265185244258471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=1020265185244258471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/1020265185244258471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/1020265185244258471'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2009/12/how-to-access-access-database-from.html' title='How to Access an Access Database from GoDaddy'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-8195424985253300840</id><published>2008-12-28T15:58:00.000-08:00</published><updated>2008-12-28T16:16:10.024-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Dev'/><title type='text'>Microsoft's bizspark program</title><content type='html'>I decided to try and use the program by Microsoft called Bizspark &lt;a href="http://www.microsoftstartupzone.com/"&gt;http://www.microsoftstartupzone.com/&lt;/a&gt;. It's basically a way for you to get your name out there with your business idea. It's also an incentive to get your idea off the ground. Some of the great benefits you get by signing up are free access to Microsoft Development tools and free webspace to try out your asp.net ideas. There are some strings attached to signing up though:&lt;br /&gt;&lt;br /&gt;1. You must pay Microsoft a $100 fee after three years.&lt;br /&gt;2. You must not have had an operating business with your idea (startups only).&lt;br /&gt;3. You must be in the business of developing software.&lt;br /&gt;4. You must be private&lt;br /&gt;5. You must have &lt; 1M in annual revenue (not a problem in my case)&lt;br /&gt;&lt;br /&gt;Also, you have to find a sponsor before you can enroll. If you are interested in enrolling you will be presented with a list of available businesses on the enrollment page willing to help sponsor along with their contact email address.&lt;br /&gt;&lt;br /&gt;Check it out and Good Luck!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-8195424985253300840?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/8195424985253300840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=8195424985253300840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/8195424985253300840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/8195424985253300840'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2008/12/microsofts-bizspark-program.html' title='Microsoft&apos;s bizspark program'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-3615826194142123177</id><published>2008-11-07T11:32:00.000-08:00</published><updated>2008-11-07T11:45:29.393-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Dev'/><title type='text'>Writing a thread-safe console log</title><content type='html'>A few days ago, I ran into the problem of how to display logging or status info in the user interface when the log messages are generated in a different thread. I found a result that seems to work satisfactorily at the moment.&lt;br /&gt;&lt;br /&gt;I'm going to give the example in VB .NET but it will work easily in C# also.&lt;br /&gt;&lt;br /&gt;First off, create a simple delegate:&lt;br /&gt;    Public Delegate Sub LogSafeCall(ByVal s As String)&lt;br /&gt;&lt;br /&gt;Then create a Sub to provide thread safety. I will use a listbox in this example but you could also use a textbox. The reason for choosing the listbox is due to the fact that it stores strings in a collection. A textbox would require appending to the text property, and...since strings are immutable, this would create many seperate strings in memory.&lt;br /&gt;&lt;br /&gt;Here's the Threadsafe logging function, m_console is a listbox control:&lt;br /&gt;    Private Sub Log(ByVal s As String)&lt;br /&gt;        If (m_console.InvokeRequired) Then&lt;br /&gt;            Dim d As LogSafeCall = New LogSafeCall(AddressOf Log)&lt;br /&gt;            m_console.Invoke(d, s)&lt;br /&gt;        Else&lt;br /&gt;            m_console.Items.Add(s)&lt;br /&gt;            'if you wish to have the last item selected then uncomment the following:&lt;br /&gt;            'm_console.SelectedIndex = m_console.Items.Count - 1&lt;br /&gt;        End If&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since I wanted to Log in a file as well as display the messages into the textbox, I created the following class and inherited the TextWriter streaming class So here is the complete code:&lt;br /&gt;&lt;br /&gt;Option Explicit On&lt;br /&gt;Option Strict On&lt;br /&gt;Imports System.IO&lt;br /&gt;Imports System.Windows.Forms&lt;br /&gt;&lt;br /&gt;Public Delegate Sub LogSafeCall(ByVal s As String)&lt;br /&gt;Public Class ListBoxWriter&lt;br /&gt;    Inherits TextWriter&lt;br /&gt;    Private m_console As ListBox&lt;br /&gt;    Public Sub New(ByVal console As ListBox)&lt;br /&gt;        m_console = console&lt;br /&gt;    End Sub&lt;br /&gt;    Public Overrides ReadOnly Property Encoding() As System.Text.Encoding&lt;br /&gt;        Get&lt;br /&gt;            Return System.Text.Encoding.ASCII&lt;br /&gt;        End Get&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;    Public Overrides Sub WriteLine(ByVal value As String)&lt;br /&gt;        MyBase.WriteLine(value)&lt;br /&gt;        Log(value)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Private Sub Log(ByVal s As String)&lt;br /&gt;        If (m_console.InvokeRequired) Then&lt;br /&gt;            Dim d As LogSafeCall = New LogSafeCall(AddressOf Log)&lt;br /&gt;            m_console.Invoke(d, s)&lt;br /&gt;        Else&lt;br /&gt;            m_console.Items.Add(s)&lt;br /&gt;            'm_console.SelectedIndex = m_console.Items.Count - 1&lt;br /&gt;        End If&lt;br /&gt;    End Sub&lt;br /&gt;End Class&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-3615826194142123177?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/3615826194142123177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=3615826194142123177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/3615826194142123177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/3615826194142123177'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2008/11/writing-thread-safe-console-log.html' title='Writing a thread-safe console log'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-7770164134438879052</id><published>2008-10-30T08:50:00.000-07:00</published><updated>2008-10-30T09:06:07.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><title type='text'>New Dell Laptop XPS M1730</title><content type='html'>Last week, I bought a Dell Laptop for my road clients. It's an XPS Model 1730 with a whopping 17" screen. I always buy my Dell stuff in the outlet store and this laptop was refurbished. It boasts a dual core 2.8 Ghz Intel CPU, 4 GB Memory and came with Vista Ultimate. I paid around $2k for the system. So far I like it very much, the bootup is very fast and all of my development software installed very nicely. It has one of those fancy new 128 MB solid state drives that the operating system resides on and I guess that's why bootup is so fast. I also have a 360GB standard Seagate drive that I purchased at tiger direct for around $80. I like the screen size very much. This is NOT a good laptop for portability since it weighs a lot and requires a mammoth sized power supply that is about 8 x 4 x 2 inches. It's great for me because I frequently need the power of a desktop without lugging a desktop around in my car. If you are working on a plane or while riding the bus, this probably would &lt;em&gt;not&lt;/em&gt; be a good choice. The power drain on the batteries is about 1 hour, perhaps one could get it to two hours by adjusting the power settings. If you require a more portable model, the XPS 15" models are just about the same as this 17" model in power and features, but much more portable and the batteries last longer. My son, Erik, uses a Dell XPS 15 while in college and likes it very much.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-7770164134438879052?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/7770164134438879052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=7770164134438879052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/7770164134438879052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/7770164134438879052'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2008/10/new-dell-laptop-xps-m1730.html' title='New Dell Laptop XPS M1730'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-6011156599090289685</id><published>2008-10-16T06:42:00.000-07:00</published><updated>2008-10-16T07:14:14.741-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Dev'/><title type='text'>CodeSmith Review</title><content type='html'>Most of my coding happens to be repetitive. Therefore I'm always thinking there's got a be a way to generate the similar code and rename the classes and various attributes. While I was on David Hayden's site &lt;a href="http://www.davidhayden.com/"&gt;http://www.davidhayden.com/&lt;/a&gt;, I saw an ad for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Codesmith&lt;/span&gt;. After reviewing the features and asking a few folks in the IT world what they thought about it, I decided to give it a try. Instantly I fell in love with it because of it's ease of use and I was instantly productive &lt;em&gt;straight out of the box!&lt;/em&gt; Here's some things I was able to do:&lt;br /&gt;Generate Code based on database &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;schema&lt;/span&gt; - using included examples&lt;br /&gt;Port my own code into a template for re-use&lt;br /&gt;Generate both VB and C# Code&lt;br /&gt;&lt;br /&gt;The &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;possibilities&lt;/span&gt; are endless, you can create libraries of code you are confident works and you wish to reuse over and over. There's a handy properties pane similar to the one in Visual Studio that you can use to change the custom properties you define in the template file. Once the template file is written, all that's required is setting a few properties in the properties pane and generating the code.&lt;br /&gt;&lt;br /&gt;There's a few videos to help you get started on the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Codesmith&lt;/span&gt; website &lt;a href="http://www.codesmithtools.com/"&gt;http://www.codesmithtools.com/&lt;/a&gt; . I highly recommend the product if you find yourself writing similar code all day. Hey, you can do a days work in 5 minutes once the template is in place! Look good all day while hardly breaking a sweat. It is a bit pricey for those, like me that are buying this themselves for around $400, but worth it in time savings.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-6011156599090289685?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/6011156599090289685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=6011156599090289685' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/6011156599090289685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/6011156599090289685'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2008/10/codesmith-review.html' title='CodeSmith Review'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-7093038234820897589</id><published>2008-10-15T19:38:00.000-07:00</published><updated>2008-10-15T19:44:10.923-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hardware'/><title type='text'>Seagate 1.5 TB Drive</title><content type='html'>Yesterday,  I received a new Seagate Barracuda 7200.11 1.5TB Hard Drive ST31500341AS - Serial ATA 7200/32MB/SATA-3G. I run a Vista Machine with Dual AMD 3GHZ Processors and ran into problems when creating the partition for this drive. It takes a long time to format/partition the drive, I guess, due to it's size. When the format reached &lt;em&gt;format: 73%&lt;/em&gt;, it just hung there all night. I googled on this and found one other person had this problem and it was resolved by enabling the second SATA controller. I don't have a second SATA controller so I ended up formatting it on another machine via a SATA drive enclosure using USB 2. Not quite the resolution I was looking for, but it worked ok. I still would hate to do this again but it worked. I guess sometimes it's &lt;em&gt;whatever works.&lt;/em&gt; Why do I have such a large drive you ask? Well, I do a lot of data intensive programming and my 500GB drive is 2/3 full allready!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-7093038234820897589?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/7093038234820897589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=7093038234820897589' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/7093038234820897589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/7093038234820897589'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2008/10/seagate-15-tb-drive.html' title='Seagate 1.5 TB Drive'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-8413302463272452699</id><published>2008-10-11T07:15:00.000-07:00</published><updated>2008-10-11T07:59:28.314-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET Dev'/><title type='text'>SQLCE and ASP.NET</title><content type='html'>Sometimes it's difficult to decide which database to use for a particular application. I found myself in this dilemma when creating my website. Most of my website is not really data centric so I was thinking maybe using MySql since it's free, or perhaps Sql Server since I already have it installed on this machine. I decided to go with Sql Compact 3.5 since it's new and I wanted to see what was involved with getting it to work with LinQ. The first problem I ran into was creating the SQL Enitity classes with the Compact Edition. It's easy to create the entities with SQL Server 2008, which involves just going to the project and adding a &lt;em&gt;LINQ to SQL Classes Template&lt;/em&gt; to your project and dragging over the tables, or whatever you need for you entity class. However, with SQL Compact, this doesn't work. You could create the entity class by hand, but that involves a lot of typing (no pun intended).&lt;br /&gt;&lt;br /&gt;Here's how I solved the problem:&lt;br /&gt;&lt;br /&gt;There's a command line tool in the Microsoft SDKs folder for creating entities for various databases called SQLMetal. It's in the folder: \Program Files\Microsoft SDKs\Windows\v6.0A\Bin\SqlMetal.exe&lt;br /&gt;&lt;br /&gt;The use of the program is as follows:&lt;br /&gt;&lt;br /&gt;SqlMetal.exe MyData.sdf &lt;database&gt;/code:MyCode.cs&lt;codepath&gt;&lt;codefile&gt;&lt;br /&gt;&lt;br /&gt;example: SqlMetal.exe northwind.sdf /code:northwind.cs&lt;br /&gt;&lt;br /&gt;That solved the problem and created the Sql Compact 3.5 entity.&lt;br /&gt;&lt;br /&gt;I created a batch file to make it easier (see below) :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@echo off&lt;br /&gt;Set SQLMetalPath="C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin"&lt;br /&gt;Set DBPath="C:\Users\Jonathan\Documents\Visual Studio 2008\WebSites\CSharpSolutions_8_2008\App_Data"&lt;br /&gt;Set AppCodePath="C:\Users\Jonathan\Documents\Visual Studio 2008\WebSites\CSharpSolutions_8_2008\App_Code"&lt;br /&gt;&lt;br /&gt;cd %DBPath%%SQLMetalPath%\SqlMetal.exe CSharpSol.sdf /code:%AppCodePath%\CSharpSol.cs&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;Here's problem #2 I had using SQL Compact 3.5 but the resolution came from Steve's site:&lt;br /&gt;&lt;br /&gt;Force SQLCE to run under ASP.NET&lt;br /&gt;Steve Lasker posted blog entry &lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/blogs.msdn.com/stevelasker/archive/2006/11/27/sql-server-compact-edition-under-asp-net-and-iis.aspx');" href="http://blogs.msdn.com/stevelasker/archive/2006/11/27/sql-server-compact-edition-under-asp-net-and-iis.aspx"&gt;on how to use SQLCE under ASP.NET&lt;/a&gt; using the pre-release version of the SQLEV. Under SQLEV you set a flag that would tell the SQL Connection, “yes I know this isn’t supported, but let me do it anyway”:&lt;br /&gt;AppDomain.CurrentDomain.SetData("SQLServerEverywhereUnderWebHosting", true)&lt;br /&gt;As you can see the name of the product is right there in the key. Well they changed the name of the product and so they changed the name of the key. So, if you were using the beta for development and are now switching over to the release version of SQLCE , you will need to change the key:&lt;br /&gt;AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true)&lt;br /&gt;That should allow you to use the database under ASP.NET. Now you can revel in the fact that you are swimming in unsupported waters!&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;br /&gt;I placed the AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true) line of code in my default page's constructor in the code behind section:&lt;br /&gt;Hope that helps&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-8413302463272452699?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/8413302463272452699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=8413302463272452699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/8413302463272452699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/8413302463272452699'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2008/10/sql-compact-and-aspnet.html' title='SQLCE and ASP.NET'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-7600312656708053404</id><published>2008-09-25T20:47:00.000-07:00</published><updated>2008-10-11T07:52:56.691-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Financial Crisis'/><title type='text'>My Thoughts on the Financial Crisis</title><content type='html'>&lt;p&gt;This is a bit off topic from the computing subject, but we are living in a remarkable time in history right now. The financial markets are about to crash probably next week. Washington Mutual just folded today and I'm certain more will follow soon. In a way, I feel that these companies deserve to fail because they were imprudent and lacked integrity. My reaction at this point is to let the market do what it does for the next few weeks before any government intervention is introduced. I know that it will hurt business since the money supply will be tight for the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;foreseeable&lt;/span&gt; future, but that's the cost of these times. The markets will eventually work themselves out without intervention from the Bush Administration, although it may be quite painful. I don't believe the role of government should be insurance for failing banks. Perhaps at the end of this mess, common sense and integrity will return to the business of banking. Well, I'm not much of a banker, and perhaps I'm all wet, but that's the way I see it.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-7600312656708053404?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/7600312656708053404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=7600312656708053404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/7600312656708053404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/7600312656708053404'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2008/09/my-thoughts-on-financial-crisis.html' title='My Thoughts on the Financial Crisis'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9080249931157151820.post-8898343852845490590</id><published>2008-09-24T08:05:00.000-07:00</published><updated>2008-09-24T12:35:00.960-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='about me'/><title type='text'>First Blog Ever!!</title><content type='html'>&lt;p&gt;Hello everyone: This is my first ever blog, hard to believe since I work in the technology field. I guess I've just been too busy writing code. Well, now that the market has slowed some, I have time to write a blog! At the risk of sounding like a dating summary, here's some information about me.&lt;/p&gt;&lt;p&gt;I live in Milwaukee, WI and work in the IT line of work as a C# or VB developer. Most of my days are spent at home writing code for my clients. I enjoy writing code and helping others solve a particular problem with their computer.&lt;/p&gt;&lt;p&gt;My hobbies include reading, playing the violin, bicycle riding, working on the house and sometimes, very rarely, due to money, I pilot small aircraft such as a Cessna 172.&lt;/p&gt;&lt;p&gt;I have a strong faith and honesty and integrity are important to me. I strive to give my clients good value and provide straight answers to their questions.&lt;/p&gt;&lt;p&gt;I read a lot of books just to keep up in this crazy work environment. One of the books I'm going through now is called asp.net unleashed 3.5 and it's a massive book that weighs a lot. When I'm through, I plan to use it as a boat anchor, since by the time I finish it, something new will have arrived. I find when I'm reading it's not enough to &lt;em&gt;just read, &lt;/em&gt;so I started my own website http://www.csharpsolutions.net.  I can run through the examples in the book on a real working environment. It's much easier to retain knowledge in my humble opinion, when you actually write the code and play around with it. The website is hosted at home in my garage and is on a Vista based PC, (Dual Core AMD processors 3500+ for you techies).&lt;/p&gt;&lt;p&gt;All of my website code is written using Microsoft ASP .NET version 3.5 framework and Visual Studio 2008. Visual Studio and the .NET framwork has made leaps in usability and functionality and is much more feature rich than previous versions. Previously, most of my html scripting was done with Dreamweaver and then the coding done in Visual Studio. Now that VS2008 has html scripting and smart code features, I prefer to use &lt;em&gt;only &lt;/em&gt;VS2008. I firmly believe there is no other comparable development environment out there for writing business applications. &lt;/p&gt;&lt;p&gt;To host my site at home, I use a third party name hosting service called ZoneEdit to redirect my assigned Time Warner IP Address to the URL. It's very handy to host the site at home, but it's probably not a good solution for business app hosting since Time Warner limits the upload bandwidth.&lt;/p&gt;&lt;p&gt;Well, thanks for reading my blog. I plan to write reviews on books I've read as well as submitting code examples and techniques I use to solve a particular problem.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9080249931157151820-8898343852845490590?l=csharpsolutionsnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpsolutionsnet.blogspot.com/feeds/8898343852845490590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9080249931157151820&amp;postID=8898343852845490590' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/8898343852845490590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9080249931157151820/posts/default/8898343852845490590'/><link rel='alternate' type='text/html' href='http://csharpsolutionsnet.blogspot.com/2008/09/first-blog-ever.html' title='First Blog Ever!!'/><author><name>Jonathan Ulfeng</name><uri>http://www.blogger.com/profile/13167360070005295392</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://2.bp.blogspot.com/_MSTQGvaowS8/SNqWyFzRaNI/AAAAAAAAAAk/swUohwZyowA/S220/jon.jpg'/></author><thr:total>1</thr:total></entry></feed>
