<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Elton's Ark</title><link>http://blogs.msdn.com/b/elton/</link><description /><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>work-around on PLS-00103 error</title><link>http://blogs.msdn.com/b/elton/archive/2006/07/31/683624.aspx</link><pubDate>Mon, 31 Jul 2006 04:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:683624</guid><dc:creator>Elton</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=683624</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2006/07/31/683624.aspx#comments</comments><description>&lt;P&gt;If&amp;nbsp;a stored procedure has a default value parameter defined&amp;nbsp;in Oracle (8i)&amp;nbsp;backend and you want to call this stored procedure using ADO with MSDAORA provider, it may fail and return a error message for some scenarios, for example:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Stored Procedure:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;##########################&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;CREATE OR REPLACE PROCEDURE SP001( InParam IN NUMBER DEFAULT 25, OutParam OUT NUMBER) AS&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;BEGIN &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;OutParam := InParam; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;END SP001;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;##########################&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Client side program:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;##########################&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Sub Main()&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Dim cn As New ADODB.Connection&lt;BR&gt;Dim cmd As New ADODB.Command&lt;BR&gt;Dim vExpected As Variant&lt;BR&gt;Dim vActual As Variant&lt;BR&gt;Dim iInParamVal As Integer&lt;BR&gt;Dim iOutParamVal As Integer&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;cn.Open "Provider=MSDAORA.1;Password=******;User ID=******;Data Source=ORA81EN"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;On Error GoTo ERR_HANDLER&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;cmd.ActiveConnection = cn&lt;BR&gt;cmd.CommandText = "SP001"&lt;BR&gt;cmd.CommandType = adCmdStoredProc&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;' Setup input param&lt;BR&gt;Set param = cmd.CreateParameter(stInParamName, adInteger, adParamInput, 4, &lt;FONT color=#ff0000&gt;&lt;STRONG&gt;Empty&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;BR&gt;cmd.Parameters.Append param&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;' Setup output param&lt;BR&gt;Set param = cmd.CreateParameter(stOutParamName, adInteger, adParamOutput, 4)&lt;BR&gt;cmd.Parameters.Append param&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;cmd.Execute&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;vExpected = 25&lt;BR&gt;vActual = cmd(0).Value&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If vExpected &amp;lt;&amp;gt; vActual Then MsgBox "compare failed"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;cn.Close&lt;BR&gt;Exit Sub&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ERR_HANDLER:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox Err.Number &amp;amp; "&amp;nbsp; &amp;lt;-&amp;gt;&amp;nbsp; " &amp;amp; Err.Description&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resume Next&lt;BR&gt;End Sub&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;##########################&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;After execute the client program,&amp;nbsp;an error message returned:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color=#ff0000&gt;-2147217900, ORA-06550: line **, column **:&lt;BR&gt;PLS-00103: Encountered the symbol "&amp;gt;" when expecting one of the following:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;. ( ) , * @ % &amp;amp; = - + &amp;lt; / &amp;gt; at in mod not rem&lt;BR&gt;&amp;lt;an exponent (**)&amp;gt; &amp;lt;&amp;gt; or != or ~= &amp;gt;= &amp;lt;= &amp;lt;&amp;gt; and or like&lt;BR&gt;between is null is not || is dangling&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;This case works fine with SQL Server backend or use MSDASQL-ORA driver with Oracle backend, but it fails with MSDAORA provider. Then how could we do if want to use the default value of the stored procedure in this scenario?&lt;/P&gt;
&lt;P&gt;The solution (or work-around) is to re-define the stored procedure and transpose the input parameter and output parameter,&amp;nbsp;just like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;##########################&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;CREATE OR REPLACE PROCEDURE SP001(&lt;FONT color=#ff0000&gt;&lt;STRONG&gt;OutParam OUT NUMBER,&amp;nbsp;InParam IN NUMBER DEFAULT 25&lt;/STRONG&gt;&lt;/FONT&gt;) AS&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;BEGIN &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;OutParam := InParam; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;END SP001;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;##########################&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In client program, only append the output parameter and execute the COMMAND to call the stored procedure. Then the case will run successfully.&lt;/P&gt;
&lt;P&gt;The reason I guess may be this:&lt;/P&gt;
&lt;P&gt;In PL/SQL, if you want to call this stored procedure, the code should be like "SP001(OutParam =&amp;gt; variable)", variable is used to store the output value. After we transpose the input and output parameter, the calling code could be like "SP001(variable)". I guess MSDAORA provider compose an invalid SQL clause. (maybe use "=" instead of "=&amp;gt;")&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=683624" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/MDAC/">MDAC</category></item><item><title>Got an error today: EventType clr20r3, P1...</title><link>http://blogs.msdn.com/b/elton/archive/2006/03/06/545090.aspx</link><pubDate>Mon, 06 Mar 2006 11:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:545090</guid><dc:creator>Elton</dc:creator><slash:comments>85</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=545090</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2006/03/06/545090.aspx#comments</comments><description>Today after I compiled my winform program in Windows XP with .NET Framework 2.0, I copied the assembly to another Windows 2003 ENT Server. When I run this program in W2k3 server, nothing responded, and following message is created in Application Events...(&lt;a href="http://blogs.msdn.com/b/elton/archive/2006/03/06/545090.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=545090" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/C_2300_+Programming/">C# Programming</category></item><item><title>Sort the objects in ArrayList</title><link>http://blogs.msdn.com/b/elton/archive/2006/02/22/536274.aspx</link><pubDate>Tue, 21 Feb 2006 21:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:536274</guid><dc:creator>Elton</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=536274</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2006/02/22/536274.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;It should be a frequent scenario to sort the order of objects in a collection, such as ArrayList. ArrayList in c# provide a method named Sort(). But we need to let&amp;nbsp;ArrayList know the detailed sorting algorithm.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;There are two means to implement this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;1. Make the target class inheritted from &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;IComparable&lt;/FONT&gt;&lt;/STRONG&gt; interface, and provide CompareTo() method. IComparable interface comes from System namespace.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;For example:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class UITestCase: &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;IComparable&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int _sequenceno = 0;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int SequenceNo&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _sequenceno;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _sequenceno = value;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;STRONG&gt;......&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // implement the IComparable interface,&amp;nbsp;define the algorithm here&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Int32 &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;CompareTo&lt;/FONT&gt;&lt;/STRONG&gt;(object next)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UITestCase nextCase = (UITestCase)next;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (this.SequenceNo.CompareTo(nextCase.SequenceNo));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } // class end.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;When using ArrayList to store a group of UITestCase objects, we could simply call ArrayList.Sort() to sort all objects in it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get all test case entities, then make sort order&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArrayList caseList = new ArrayList();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (DirectoryInfo dir in nodeDirInfo.GetDirectories("*.tc"))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UITestCase testcase = new UITestCase(dir.FullName);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; caseList.Add(testcase);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (caseList.Count &amp;gt; 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;caseList.Sort();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;2. Create a class inherited from &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;IComparer&lt;/FONT&gt;&lt;/STRONG&gt; interface, then implement Compare(object x, object y) method just like IComparable's CompareTo(object next) method.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;3. Write a special method to sort the order of a given ArrayList like what we will do in&amp;nbsp;C language, I prefer this one because I think the codes writing in above two methods are not&amp;nbsp;straightforward enough.&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=536274" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/C_2300_+Programming/">C# Programming</category></item><item><title>the LabelEdit property in TreeView class</title><link>http://blogs.msdn.com/b/elton/archive/2006/01/21/515383.aspx</link><pubDate>Fri, 20 Jan 2006 19:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:515383</guid><dc:creator>Elton</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=515383</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2006/01/21/515383.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face="Courier New"&gt;Today I want to add the RENAME feature to maintain the Test Case Tree in StepRecorder, which exactly like the operation in Windows Explorer. After user right click a node, the selected node turns to Edit Mode, and user could type the new name in the edit box. System will ask user to reinput the new name if some invalid characters are entered such as "!"/","/"@"... and the selected node will remain in its Edit Mode for user's re-input.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;To carry out this function, TreeView.LabelEdit property,&amp;nbsp;TreeNode.BeginEdit() and TreeNode.EndEdit(bool) will be used as well as the TreeView.AfterLabelEdit event.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Here is a demo code from MSDN and I think it&amp;nbsp;greatly show&amp;nbsp;how these property/method/event work together.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;/* Get the tree node under the mouse pointer and &lt;BR&gt;&amp;nbsp;&amp;nbsp; save it in the mySelectedNode variable. */&lt;BR&gt;private void treeView1_&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;MouseDown&lt;/FONT&gt;(object sender, &lt;BR&gt;&amp;nbsp; System.Windows.Forms.MouseEventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; mySelectedNode = treeView1.GetNodeAt(e.X, e.Y);&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;private void menuItem1_Click(object sender, System.EventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; if (mySelectedNode != null &amp;amp;&amp;amp; mySelectedNode.Parent != null)&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; treeView1.SelectedNode = mySelectedNode;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; treeView1.LabelEdit = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!mySelectedNode.IsEditing)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mySelectedNode.BeginEdit();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp; else&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("No tree node selected or selected node is a root node.\n" + &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Editing of root nodes is not allowed.", "Invalid selection");&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;private void treeView1_AfterLabelEdit(object sender, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Windows.Forms.NodeLabelEditEventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; if (e.Label != null)&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(e.Label.Length &amp;gt; 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.Label.IndexOfAny(new char[]{'@', '.', ',', '!'}) == -1)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Stop editing without canceling the label change.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Node.EndEdit(false);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Cancel the label edit action, inform the user, and &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; place the node in edit mode again. */&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.CancelEdit = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Invalid tree node label.\n" + &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "The invalid characters are: '@','.', ',', '!'", &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Node Label Edit");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Node.BeginEdit();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Cancel the label edit action, inform the user, and &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; place the node in edit mode again. */&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.CancelEdit = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Invalid tree node label.\nThe label cannot be blank", &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Node Label Edit");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Node.BeginEdit();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.treeView1.LabelEdit = false;&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=515383" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/C_2300_+Programming/">C# Programming</category></item><item><title>How to drag and drop the treenode in TreeView Controls</title><link>http://blogs.msdn.com/b/elton/archive/2005/12/16/504515.aspx</link><pubDate>Fri, 16 Dec 2005 05:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:504515</guid><dc:creator>Elton</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=504515</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2005/12/16/504515.aspx#comments</comments><description>&lt;P&gt;Found a great article on this, and I will investigate it latter.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.codeproject.com/cs/miscctrl/TreeViewDragDrop.asp"&gt;http://www.codeproject.com/cs/miscctrl/TreeViewDragDrop.asp&lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=504515" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/C_2300_+Programming/">C# Programming</category></item><item><title>How to solve the issue of "The server instance specified was not found. Please specify the server's address and port."?</title><link>http://blogs.msdn.com/b/elton/archive/2005/11/22/495743.aspx</link><pubDate>Tue, 22 Nov 2005 17:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:495743</guid><dc:creator>Elton</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=495743</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2005/11/22/495743.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana&gt;Today, when I want to use "stsadm -o&amp;nbsp;addwppack..."&amp;nbsp;command to add a web part into the team website, an error message returned&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#ff0000&gt;&lt;STRONG&gt;"The server instance specified was not found. Please specify the server's address and port"&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000&gt;Fortunatelly, I seeked for the help from Mohammed's blog: &lt;/P&gt;
&lt;H2&gt;&lt;FONT size=3&gt;&lt;a href="http://blogs.msdn.com/mjeelani/archive/2005/03/05/385816.aspx"&gt;Top 3 Reasons for the "The server instance specified was not found. Please specify the server's address and port." Error&lt;/A&gt;&lt;/FONT&gt;&lt;/H2&gt;
&lt;P&gt;My issue is the 1st reason that&amp;nbsp;we&amp;nbsp;have installed&amp;nbsp;sharepoint SP1 build, but didn't upgrade all the virtual server, after I run following command, the web part could be added successfully.&lt;/P&gt;
&lt;P&gt;stsadm -o upgrade -forceupgrade&lt;/P&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=495743" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/SharePoint/">SharePoint</category></item><item><title>A good article on how to create the Area Templates in SPS2003</title><link>http://blogs.msdn.com/b/elton/archive/2005/11/17/493831.aspx</link><pubDate>Thu, 17 Nov 2005 13:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:493831</guid><dc:creator>Elton</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=493831</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2005/11/17/493831.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana&gt;Today, Jeffrey asked me to find how to create Area Template and it will be used in his new team site. Fortunately, I find an article with detail information.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A id=viewpost.ascx_TitleUrl href="http://weblogs.asp.net/mnissen/articles/68629.aspx"&gt;Working with Sharepoint Portal Server 2003 Area Templates&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=493831" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/SharePoint/">SharePoint</category></item><item><title>How to display Visio file in SharePoint web part</title><link>http://blogs.msdn.com/b/elton/archive/2005/10/21/483452.aspx</link><pubDate>Fri, 21 Oct 2005 17:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:483452</guid><dc:creator>Elton</dc:creator><slash:comments>18</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=483452</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2005/10/21/483452.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana&gt;I have an idea recently that I want our project web site could display Office Visio file and Office Project .mpp file. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Visio attract me very much for its powerful diagram elements, it could centralize my thinking in a diagram and it is so easy understanding and abstractive in every phase of project life cycle. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;For .mpp file I want to replace normal list web part with gantt diagram. Normally we maintain a task list in SharePoint account for the project schedule, but I'd rather to use project file to plan and monitor the project status, because task list is not straitforward for task dependency and task hierarchy, but gantt diagram is a good choice to me.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;I found a method to display visio file in SharePoint web part and I don't know if it is the only solution or not now.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Visio 2003 Viwer active-x control must be installed in client machine even if&amp;nbsp;it has office 2003 installed,&amp;nbsp;before client user browse the sharepoint web page containing visio web part&amp;nbsp;(I don't like this, but in vain). This active-x control is an add-in of IE to display visio diagram. It could be found at &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=3FB3BD5C-FED1-46CF-BD53-DA23635AB2DF&amp;amp;displaylang=en"&gt;&lt;FONT face=Verdana&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=3FB3BD5C-FED1-46CF-BD53-DA23635AB2DF&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;In SharePoint you could drag &amp;amp; drop a Content Editor web part onto a web part page, then click "Source Editor" button to imput following:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&amp;lt;OBJECT classid="CLSID:279D6C9A-652E-4833-BEFC-312CA8887857" &lt;BR&gt;codebase="http://download.microsoft.com/download/4/5/2/452f8090-413f-408f-83c0-edd66db786ee/vviewer.exe" &lt;BR&gt;id="viewer1" width="100%" height="100"&amp;gt; &lt;BR&gt;&amp;lt;param name="BackColor" value="16777120"&amp;gt;&lt;BR&gt;&amp;lt;param name="AlertsEnabled" value="1"&amp;gt;&lt;BR&gt;&amp;lt;param name="ContextMenuEnabled" value="1"&amp;gt;&lt;BR&gt;&amp;lt;param name="GridVisible" value="0"&amp;gt;&lt;BR&gt;&amp;lt;param name="HighQualityRender" value="1"&amp;gt;&lt;BR&gt;&amp;lt;param name="PageColor" value="16777215"&amp;gt;&lt;BR&gt;&amp;lt;param name="PageVisible" value="1"&amp;gt;&lt;BR&gt;&amp;lt;param name="PropertyDialogEnabled" value="1"&amp;gt;&lt;BR&gt;&amp;lt;param name="ScrollbarsVisible" value="1"&amp;gt;&lt;BR&gt;&amp;lt;param name="ToolbarVisible" value="1"&amp;gt;&lt;BR&gt;&amp;lt;param name="SRC" value=&lt;FONT color=#ff0000&gt;"&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&lt;A href="http://wssxxxx/Shared%20Documents/Yukon%20Timeline.vsd"&gt;&lt;FONT color=#ff0000&gt;http://wssxxxx/Shared%20Documents/Yukon%20Timeline.vsd&lt;/FONT&gt;&lt;/A&gt;"&lt;/FONT&gt;&amp;gt;&lt;BR&gt;&amp;lt;param name="CurrentPageIndex" value="0"&amp;gt;&lt;BR&gt;&amp;lt;param name="Zoom" value="-1"&amp;gt;&lt;BR&gt;&amp;lt;/object&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Red color string indicates the visio file's location in SharePoint. Other parameters could be set according to its effect in IE visio viewer.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;The result doesn't meet my idea completely, anyway it is&amp;nbsp;a solution for displaying the visio file in SharePoint.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Useful link: &lt;A href="http://www.wssdemo.com/Pages/visio.aspx?menu=Articles"&gt;http://www.wssdemo.com/Pages/visio.aspx?menu=Articles&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=483452" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/SharePoint/">SharePoint</category></item><item><title>Learning Notes - Extreme Programming (1)</title><link>http://blogs.msdn.com/b/elton/archive/2005/09/17/470229.aspx</link><pubDate>Sat, 17 Sep 2005 15:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:470229</guid><dc:creator>Elton</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=470229</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2005/09/17/470229.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana&gt;XP is a new development model which I first heard at last year. Recently I had a book named "Extreme Programming Adventures in C#" and&amp;nbsp;I am&amp;nbsp;a bit interested in it and decide to write down what I learned and what I thought.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Today, suddenly when I am smoking a question jump out of my brain: most of the human being inventions include computer science are based on the purpose of decreasing the heavy workload and making our life more free and happy, but why most people still work so hard and with heavy pressure[:)]?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;XP team is composed with two roles which are Customers and Programmers. The first role provides the software requirements or features and the second role is accountable for making how to realise all the features. A person may belong a Customer or Programmer or both.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;XP development process is a series of iteration in which only simple function is implemented and tested. This character is something similar with RUP model. The key point is how to break down the features into "stories" which is the objective of one iteration. (Story is a new&amp;nbsp;item for me in here)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Often I have some idea to develop something by myself but I can't get whole picture of what I will make. XP make me have another idea that don't hesitate to&amp;nbsp;go ahead&amp;nbsp;before everything&amp;nbsp;is planned, just do what I think at that point.&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=470229" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/Learning+Notes/">Learning Notes</category></item><item><title>How to take advantage of office components in sharepoint portal server - spreadsheet</title><link>http://blogs.msdn.com/b/elton/archive/2005/05/31/423365.aspx</link><pubDate>Mon, 30 May 2005 19:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:423365</guid><dc:creator>Elton</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/elton/rsscomments.aspx?WeblogPostID=423365</wfw:commentRss><comments>http://blogs.msdn.com/b/elton/archive/2005/05/31/423365.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana&gt;My boss confirmed it is acceptable that our website's users need MS Office 2003 installed in their local machine to interact with the Office Components in the web page.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;I found the solution to avoid users modify spreadsheet data directly. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;First, let's see where is the data source of the web part. After I drag spreadsheet web part to&amp;nbsp;one of&amp;nbsp;web part zones, we can set data source from "Data Connect..." button to select SQL Server or other type. In my scenario, I use Spreadsheet Add-in tool (&lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=dc3d8474-d960-4d14-a9df-9024e39f5463&amp;amp;DisplayLang=en"&gt;&lt;FONT face=Verdana&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=dc3d8474-d960-4d14-a9df-9024e39f5463&amp;amp;DisplayLang=en&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt;)&amp;nbsp;to create data files which is required by the web part. This add-in tool generate three files which is the spreadsheet's data source files and I put them into one of the document library in SPS (add-in tool can help you finish this operation).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Second, what these three files are and how they control the web part? &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;1. Spreadsheet file in XML format, spreadsheet's data contents&amp;nbsp;are saved here, included data format, formula etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;2. Solution specification file,&amp;nbsp;discribes where is the spreadsheet file listed above saved, connection interfaces definition and other many settings.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;3. .dwp file, just like normal web part, it specifies the assembly and properties.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;To create the relationship between the web part and these three files, we just click the right arrowhead of the spreadsheet web part, and select "Modify Shared Web Part", set "Solution Specification File" property&amp;nbsp;with the second file's hyperlink in SPS.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;To avoid users from directly modifiing the contents of the spreadsheet web part, we need add a line in Solution Specification File to lock the page, just like follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&amp;nbsp; &amp;lt;WebPartSettings&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;XMLSSFileLocation&amp;gt;/myDocLib/.....&amp;lt;/XMLSSFileLocation&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;......&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#ff0000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;LockedDown&amp;gt;true&amp;lt;/LockedDown&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/WebPartSettings&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Want to know&amp;nbsp;other detail settings about Solution Specification File, please came&amp;nbsp;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=29E1FC0C-7627-45ED-AB75-1C5080F6AC1D&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=29E1FC0C-7627-45ED-AB75-1C5080F6AC1D&amp;amp;displaylang=en&lt;/A&gt;.&lt;/FONT&gt;&lt;FONT face=Verdana&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;After&amp;nbsp;refresh the page, we will find that the spreadsheet web part is basicly same with what you see in Excel tool. Although we can change the data in our personal view, the data&amp;nbsp;changed really is NOT committed to the data source file. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;When we want to modify the web part's contents, just edit the first file. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;It is cool, yes?&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=423365" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/elton/archive/tags/SharePoint/">SharePoint</category></item></channel></rss>