Sunday, February 25, 2007

I hate to steal a blog post but Scott Hanselman always finds the coolest tools.
http://www.hanselman.com/blog/BinaryFortressSoftwaresASPNETViewStateHelperATreasureTroveOfTools.aspx

 

This time it is binary fortress. It is a tool for viewing View State. It is easy to use and to the point.

Thanks for pointing it out Scott.

Doc

posted on Monday, February 26, 2007 12:03:21 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback

Well, I finally did it, I set up my office 2007 to allow me to blog from word. It is pretty Cool.

It allows me to easily cross stuff things words out. Color how I want. Add pictures with cut and paste. Using Snag-it.

UPDATE : Can't seem to publish pictures yet….hmmmmm… I wonder why

UPDATE 2: User Error… I did not format my FTP String Correctly

And format them however I want.

I can select specific categories but the best thing is the fact that I get SPELL CHECK!!! I really need this ;)

Pretty cool stuff…. I use das Blog so I upgraded to the 1.9 version and used this tutorial to get it done.

http://www.colinneller.com/blog/SyndicationService.asmx/GetRssCategory?categoryName=Office

Happy Programming

Doc

posted on Sunday, February 25, 2007 6:06:19 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
Thursday, February 22, 2007

I have had a heck of a problem with Adobe on my system and it was driving me crazy. It would work as a stand-alone program, but whenever I tried to open up a PDF file through IE, it would lock up first IE and then Regular Explorer.  So you would think I could just uninstall and re-install right???

Well you would be wrong. First, when I tried to uninstall, it told me that I was missing a patch file and would have to abort......Great....just what I wanted....

So I found this tool from MS that allows you to remove items that were installed using Windows Installer

http://support.microsoft.com/default.aspx?kbid=290301

It seems pretty straight forward, Click on the program and select Remove.

That went pretty smooth. But then when trying to re-install Adobe Acrobat version 8 (The current version), I could not get the Adobe downloader to work.

What a pain !!!!!!!!!!!

Well, to make a long story short.... I am sure there is a work-around to this.... but I instead found a stand-alone installer at this link.

http://ardownload.adobe.com/pub/adobe/reader/win/7x/7.0.8/enu/AdbeRdr708_en_US.exe

It is only 7.0.8, but at least my system doesnt crash now :).   Maybe when I have time I will troubleshoot this more.

Happy (or not so happy) programing.

Doc

posted on Thursday, February 22, 2007 11:38:39 PM (GMT Standard Time, UTC+00:00)  #    Comments [1] Trackback
Saturday, August 19, 2006

So I have mentioned before that LADotNet.org runs a Masters Series on Saturdays and this Saturday is no different. This week it is being presented by Ken Getz. Ken is a great presenter and we are glad to have him back in California (Sorry Florida). Anyway, as he was going through delegates and events and he covered something I was not aware of.

Anonymous Delegates. Whenever I used delegates in the past, I aways had a method that could be passed that would handle the call. You can also pass a proceedure or "Block of Code" instead of passing a pointer to a method like below. (Both C# and VB)

  184     static void AnonymousDelegate()

  185     {

  186       FileSearch4 fs =

  187         new FileSearch4("C:\\", FILESPEC, false);

  188       fs.Handler =

  189         delegate(FileInfo file)

  190         {

  191           Console.WriteLine("{0} ({1})",

  192             file.FullName, file.Attributes);

  193         };

  194       fs.Execute();

  195     }

 

I am not sure of a real use for this but it was interesting to see someting new.

 

Doc

posted on Saturday, August 19, 2006 10:12:53 PM (GMT Daylight Time, UTC+01:00)  #    Comments [1] Trackback
Friday, July 14, 2006

As part of DotNetDoc's new "Ask the Doc" format, we are starting our journey by taking a page from the Zen Master himself Scott Hanselman. We will be walking through his list of questions posted in his, "What Great .NET Developers Ought To Know" post. We will not only try to answer the questions but give each a "deep dive" so that we not only can answer the question, but so that we UNDERSTAND the answer. We will go one question at a time until we reach the end. I hope you enjoy, and thanks Scott for the thought provoking questions.

.Net Ought To Know #7 : What is a PID? How is it useful when troubleshooting a system?

If you have ever used the task manager (right-click on start bar and select Task Manager) and gone to the Process tab, then you have seen the processes that are running on your system. The default set-up of the task manager does not show the PID or Process ID. To add this, go to View/Add Columns on the menu and check the box next to PID(Process Identifer).

The PID is an integer that is assigned to each process in your operating system.It is usefull when you need to diagnose problems with your application since it allows you to uniquely identify each process.

 

In the .Net framework, you can access this information by using the System.Diagnostics namespace.

   

    1 Imports System

    2 Imports System.Diagnostics

    3 

    4 Friend Class Class1

    5     <STAThread()> _

    6     Shared Sub Main(ByVal args As String())

    7         Dim strRemark As String

    8         ' remarks to insert into the console output

    9 

   10         Console.WriteLine("all processes of the system")

   11         Console.WriteLine()

   12 

   13         Dim myProcesses As Process() = Process.GetProcesses()

   14         ' all processes into the array

   15 

   16         For Each p As Process In myProcesses

   17             If p.Id = Process.GetCurrentProcess().Id Then

   18                 ' the process id is unique in the system

   19                 strRemark = " < = my application"

   20             Else

   21                 strRemark = ""

   22             End If

   23 

   24             If p.ProcessName = _

   25             Process.GetCurrentProcess().ProcessName _

   26             AndAlso p.Id <> Process.GetCurrentProcess().Id Then

   27                 ' an additional instance of the same

   28                 ' application has the same name,

   29                 ' but an other process id

   30 

   31                 strRemark = " <= another instance of app"

   32             End If

   33 

   34             Console.WriteLine _

   35             ("{0}  {1}  {2}", p.ProcessName, p.Id, strRemark)

   36         Next p

   37 

   38         Console.WriteLine()

   39         Console.ReadLine()

   40         ' this ReadLine command is to hold the application open

   41     End Sub

   42 End Class

 

Happy Programming.

Doc

posted on Friday, July 14, 2006 1:45:21 PM (GMT Daylight Time, UTC+01:00)  #    Comments [1] Trackback
Wednesday, July 12, 2006

As part of DotNetDoc's new "Ask the Doc" format, we are starting our journey by taking a page from the Zen Master himself Scott Hanselman. We will be walking through his list of questions posted in his, "What Great .NET Developers Ought To Know" post. We will not only try to answer the questions but give each a "deep dive" so that we not only can answer the question, but so that we UNDERSTAND the answer. We will go one question at a time until we reach the end. I hope you enjoy, and thanks Scott for the thought provoking questions.

.Net Ought To Know #6 : Corillian's product is a "Component Container." Name at least 3 component containers that ship now with the Windows Server Family?

The answer to the question is not that tough so I thought we would go a little deeper and talk about Components, Controls, and Containers Oh My!! (Sorry I couldn't resist). In the .Net Framework, simply put, a component is a class that implements the System.ComponentModel.IComponent interface or derives from a class that does. A component is something that can be reused. C# is considered a component-oriented language. Re-use is everything in component-oriented design. Putting together pre-tested parts is faster and cheaper then coding it yourself. So to summertime, a component is any class that directly or indirectly implements the IComponent Interface. A component can be added to the toolbox and dragged and dropped onto a form.

A control on the other hand is a component that provides a UI. To do this you need to implement System.Windows.Forms.Control OR System.Web.UI.Control. So a control is basically a component that has visual properties.

This finally leads us to the answer to this question. You need a place to hold your components and controls. This is done in a Container. A Container is a class that implements the System.ComponentModel.IContainer interface (directly or indirectly). Since this container holds your controls, it is easy to access the controls dynamically.

    9 Private Class ControlWalker

   10     Private mContainer As Object

   11     Public Sub New(ByVal Container As Object)

   12         Dim cControl As Control

   13         If Container.haschildren Then

   14             For Each cControl In Container.controls

   15                 'add this control to the controls collection

   16                 m_controls.Add(cControl)

   17                 If cControl.HasChildren Then

   18                     'This control has children, create another

   19                     'ControlWalk go visit each of them

   20                     Dim cWalker As New ControlWalker(cControl)

   21                 End If

   22             Next cControl

   23         End If

   24     End Sub

   25 End Class

So you tell me now, this should be easy. What are 3 containers in then Windows Server Family?

Happy Programming.

Doc

posted on Wednesday, July 12, 2006 12:17:16 PM (GMT Daylight Time, UTC+01:00)  #    Comments [3] Trackback
Monday, July 10, 2006

As part of DotNetDoc's new "Ask the Doc" format, we are starting our journey by taking a page from the Zen Master himself Scott Hanselman. We will be walking through his list of questions posted in his, "What Great .NET Developers Ought To Know" post. We will not only try to answer the questions but give each a "deep dive" so that we not only can answer the question, but so that we UNDERSTAND the answer. We will go one question at a time until we reach the end. I hope you enjoy, and thanks Scott for the thought provoking questions.

.Net Ought To Know #5 : What is strong-typing versus weak-typing? Which is preferred? Why?

In strongly-typed programming languages you usually have to declare variables prior to using them. Strong-typing is the strict enforcement of [type] rules. All types (int, short, long, string) are know at compile time and are statically bound. So C# is a strongly-typed language because variables must be assigned a type before you use them. If you came from the ASP world then you will remember having to use either Javascript or VBScript. Variables that you declare in either of those languages can hold any data type which makes it weakly-typed.

But lets take this up a level. Instead to talking about programming languages, lets talk about strongly-typed/weakly-typed objects. The DataSet object is a great example. If we use a weakly-typed dataset, the developer needs to know the name of the table and the name of the field being requested. Since we are just passing strings, this code will compile and will not show any possible problems (like typing the name of the table wrong) until run time.

  string s = (string) myDataSet.Tables["Customers"].Rows[0]["CustomerID"];

If our Dataset is Strongly-Typed, we are able to access the names of the tables and columns directly. Any errors are caught at compile time.

  string s = myDataSet.Customers[0].CustomerID;

I am not really going to argue which is better, I will leave that up to you. I will leave you with this question though; would you rather catch your errors at compile time, or run-time?

Happy Programming.

Doc

posted on Monday, July 10, 2006 9:24:56 AM (GMT Daylight Time, UTC+01:00)  #    Comments [1] Trackback
Sunday, July 09, 2006

Setting up membership for your ASP.Net website is pretty simple. All you need to do is:

  1.  run the scripts using the aspnet_regsql.ext tool (C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\aspnet_regsql.exe    your version number may be diferent) to set up the database tables.
  2. Add a membership section to your web.config. Making sure that you add the <clear/> tag since you need to override the machine.config.

       41     <membership>

       42       <providers>

       43         <clear/>

       44         <add name="AspNetSqlMembershipProvider"

       45                   type="System.Web.Security.SqlMembershipProvider,
                             System.Web, Version=2.0.0.0, Culture=neutral,
                             PublicKeyToken=b03f5f7f11d50a3a
    "

       46                   connectionStringName="LocalSqlServer"

       47                   enablePasswordRetrieval="false"

       48                   enablePasswordReset="true"

       49                   requiresQuestionAndAnswer="true"

       50                   applicationName="/"

       51                   requiresUniqueEmail="false"

       52                   minRequiredPasswordLength="1"

       53                   minRequiredNonalphanumericCharacters="0"

       54                   passwordFormat="Hashed"

       55                   maxInvalidPasswordAttempts="5"

       56                   passwordAttemptWindow="10"

       57                   passwordStrengthRegularExpression="" />

       58       </providers>

       59     </membership>

       60   </system.web>

  3. Add a connection string once again using the <clear/>  tag to clear out the machine.config settings. (I will tell you why soon) 

       16   <connectionStrings>

       17     <clear/>

       18     <add name="LocalSqlServer" connectionString="Data
                 Source=xxx;Initial Catalog=xxx;Persist Security
                 Info=True;User ID=xxxx; password=xxx
    " />

       19   </connectionStrings>


  4. Then load up the Web Site Administration Tool by going to Website\Asp.Net Configuration in VS2005.

  5. You will then be about to configure your membership using SQL2000/2005 using this tool.

So where is the gotcha you might ask?  Well, if you try to name your connection string anything other than LocalSqlServer, when you get to the provider tab you will see a message that says "No Provider Created".  This is why you need to clear out the connection string section using the  <clear/> tag so that you can override the setting in the machine.config.  

 

I hope that helps someone.

Happy Programming

 

Doc


posted on Sunday, July 09, 2006 11:10:27 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
Friday, July 07, 2006

I was just talking to a possible client the other day when the inevitable subject of "Which Technology is the Best" came up. He was a designer but also did a little bit of PHP. The reason he used PHP was because that was what his other Designer friends used.  This of course started up the "Which is better" argument/discussion.

I have always firmly held the stance that :  I JUST DONT CARE. 

C# or VB.Net, which is better?   Who cares?  What is the client paying for? I program in both, and you should too.

ASP/ASP.Net or PHP?  Who Cares,  how many jobs can I get doing PHP sites and how many with ASP/ASP.Net. ( You may have noticed that I did not even go into the enormous difference between PHP and ASP.Net)

The bottom line is, go where you can find work AND do it well!!!  Whatever you do.  

On that note, I found a great blog post that talks about this HERE.  Check it out.

Happy Programming!

DotNetDoc

posted on Saturday, July 08, 2006 1:56:32 AM (GMT Daylight Time, UTC+01:00)  #    Comments [3] Trackback

OK... So one of the blogs I read is from a very technical person who writes a very non-technical blog. Most of the .Net world already knows who his is but if you have been living on another planet, his name is Rory Blyth.

Now his blog can get a little over the top for me sometimes but it is usually hysterically funny.  So I was going through some emails recently and I came across a couple of his posts that I had emailed to someone. The cracked me up all over again.

So I thought I would share them:

The first one is about his experience with T-Mobile and their phone system. Maybe you need to be a customer to find this funny but ..... well maybe not.

http://neopoleon.com/blog/posts/14880.aspx

The second one is more of a cartoon then a blog post. If you have ever worked in a corporate environment, you will definitely get a kick out of this. On the other hand, if you say "I don't get it", then you are management material all the way!!

 http://www.neopoleon.com/blog/posts/434.aspx

Enjoy

DotNetDoc

 

 

posted on Saturday, July 08, 2006 12:08:18 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback