tag:blogger.com,1999:blog-29851940176243124622024-03-21T13:14:01.137+07:00Dane's blogDiscussion C#, VB, Asp.net, SQL Server, Javascript, JquerySavot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.comBlogger46125tag:blogger.com,1999:blog-2985194017624312462.post-90621212138296464292010-08-28T20:18:00.000+07:002010-08-28T20:18:59.084+07:00Education Raodmap, Create Games for Window Phone 7<div class="separator" style="clear: both; text-align: center;"><img border="0" height="467" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4oCTmnACp0FxzO3kIok3N30iaAqAoOFdnQSaUZm3vNrNsnDmm-6K2znP_Cst4KE01M80tKDKD0YfqBV-Kzzh5fKdLGFGcc_ISCC8igVjlB70taQ3S10vvXICvo3EWSz7HlEn9TLFPmchG/s640/image_2A874DB7.png" width="640" /> </div><div class="separator" style="clear: both; text-align: center;"><a href="http://creators.xna.com/en-US/education/gettingstarted">http://creators.xna.com/en-US/education/gettingstarted</a></div>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-31374926034017626652010-07-21T15:25:00.003+07:002010-07-21T16:54:36.261+07:00Step by step instructions for android on hd2I've just got a very detail instruction to get android working on HTC HD2.<br />
<br />
<blockquote>STEP BY STEP INSTRUCTIONS FOR TESTING ANDROID ON HD2<br />
<br />
1) Download an Android build (with or without sense user interface) (e.g. from gamesquare.co.uk)<br />
2) Extract the contents to the ROOT of your sd card (Preferably format the card beforehand)<br />
3) Launch any file manager from within windows mobile.<br />
4) Launch haret.exe in the root of your sd (storage) card. Click Run (Preferably just after a soft reset)<br />
Thats it!<br />
<br />
Important Notes:<br />
YOU WILL GET A BLACK/BLANK SCREEN (Linux text will disappear) if you don't have 2.xx.50.xx radio rom version. (2.xx.51.xx will not work)<br />
Yes 51 radio versions are european and 50 radio versions are US, BUT 50 radio WILL WORK with your european HD2. In any case, you can always go back to your original radio. (Write down your version beforehand. You can get the info from HTC startup screen or from settings - phone information - software information<br />
You don't need HSPL for linux boot. But you need HSPL if you need to change your radio to a 50 version. Your phone comes with original SPL only.<br />
<br />
STEPS ONLY IF YOU GET BLACK SCREEN:<br />
The following information is ONLY needed if your linux doesn't boot and freezes with black screen and you want to change your radio to a linux compatible one.<br />
1) Get HSPL3 from: forum.xda-developers.com/showpost.php?p=6891358&postcount=1893 (Only if you don't have HSPL, if you don't know, then you don't have HSPL)<br />
2) Get a 2.xx.50.xx radio rom from: forum.xda-developers.com/showthread.php?t=611787 (2.10.50.xx is fine)<br />
3) Get Custom RUU from: forum.xda-developers.com/showpost.php?p=4798017&postcount=1<br />
4) Install HSPL(connect your phone in activesync mode via usb cable)<br />
5) Install 2.xx.50.xx radio via customruu. Don't worry about what CustomRUU says, you will not lose settings and data. (It won't hard reset when upgrading only the Radio ROM)<br />
Thats it! Now you can run haret and boot android<br />
PLEASE COPY PASTE THE LINKS BECAUSE I AM NOT ALLOWED TO POST LINKS.</blockquote><a href="http://forum.xda-developers.com/showthread.php?t=723200">Dual boot android and win mobile</a><br />
<a href="http://forum.xda-developers.com/showthread.php?t=611433">HSPL How To</a><br />
Via: http://forum.xda-developers.com/showthread.php?p=7108995#post7108995Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-74111859357997617302010-07-08T14:08:00.001+07:002010-12-02T11:45:05.660+07:00PDF libraries http://www.pdfsharp.net/MainPage.ashx<br />
<br />
http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=12&Itemid=40<br />
<br />
http://csharp-source.net/open-source/pdf-libraries<br />
http://sourceforge.net/projects/itextsharp/Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-10831406094797096342010-07-05T09:15:00.000+07:002010-07-05T09:15:15.609+07:00Implement MultiTouch Behavior in Window Phone 7There are two video demonstrate the implementation MultiTouch Behavior in Window Phone 7 by Microsoft MVP Laurent Bugnion, an author of Silverlight 4 Unleashed. <br />
<br />
Here, quote from Laurent:<br />
<br />
<i>I just published two videos on Vimeo (see the embedded videos at the end of this post)<br />
<br />
* One is a short video showing the highlights of the MultiTouch Behavior I have been working on. It shows what gestures are available, and how easy it is to add it to a Windows Phone 7 application.<br />
* The other is a detailed 15’ video that explains exactly how the behavior can be used.<br />
<br />
I am still polishing a few things up and should be ready to release V1 on Codeplex very soon.<br />
</i><br />
<h4><i>Features:</i></h4><i><br />
* Scale, Rotate, Translate are supported.<br />
* Possibility to show markers on the screen for demos/projections/videos.<br />
* Debug mode with addition on-screen information.<br />
* “Mock” mode for development without multitouch screen. Simulate fingers with just one mouse.<br />
* Enable/disable Scale, Rotate, Translate X and Y individually.<br />
* Constrain Scale with minimum and maximum value.<br />
<br />
</i><br />
<h4><i>Future plans:</i></h4><i><br />
Not supported (but in the plan) are:<br />
<br />
* Multiple elements: Right now, the gestures can only apply to one element on the screen.<br />
* Friction/inertia.<br />
* Constraining the element to the screen.<br />
<br />
</i><br />
<h4><i>More info</i></h4><i><br />
I will post more info as we progress. Stay tuned to this blog (“touch” tag), on my website http://www.galasoft.ch/touch or on Twitter (@LBugnion).<br />
Credits<br />
<br />
I want to thank Pete Blois (from the Microsoft Expression Blend team) for his help and some of the multitouch code, and the kind permission to open source it.<br />
<br />
Also heartful thanks to Davide Zordan for starting this project on Codeplex and for the inspiration.<br />
</i><br />
<h4><i>The Videos</i></h4><i><i></i></i><br />
The first video is a demonstration of his MultiTouch behavior implemented in a demo applications:<br />
<br />
<object height="225" width="400"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13077859&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13077859&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object><br />
<br />
The second video is a 15mins long tutorial showing you how to implement it in your application:<br />
<br />
<object height="225" width="400"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13075008&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13075008&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object><br />
<br />
Source: <a href="http://blog.galasoft.ch/archive/2010/07/04/multitouch-behavior-for-windows-phone-7-videos-wp7dev.aspx">Laurent Bugnion</a>, <a href="http://www.mobiletechworld.com/2010/07/04/windows-phone-7-multitouch-behavior/#more-12338">mobiletechworld</a>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-21706251947822052052010-06-29T09:56:00.000+07:002010-06-29T09:56:06.093+07:00Learn Silverlight and Expression Blend in 5 days<h3>Learn how to design and develop innovative user interfaces for Window Phone 7,..using Expression Blend 4.0</h3><br />
Head over: <a href="http://www.microsoft.com/expression/resources/BlendTraining/">Learn Silverlight and Expression Blend in 5 days</a>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com5tag:blogger.com,1999:blog-2985194017624312462.post-31517287577632972422010-06-23T09:32:00.000+07:002010-06-23T09:32:23.238+07:00Windows Phone 7 Design Resources<div class="headline_area"><h1 class="entry-title">Windows Phone 7 Design Resources </h1><div class="headline_meta">I've just got good resources from: <br />
<a href="http://davidcrow.ca/article/7511/wp7-design-resources"><span class="author vcard fn">davidcrow</span> on <abbr class="published" title="2010-06-21">June 21, 2010</abbr></a></div></div><div class="wp-caption alignnone" id="attachment_7534" style="width: 300px;"><a href="http://blogs.claritycon.com/blogs/windows_phone_7/archive/2010/04/25/extreme-makeover-phone-edition-comcast-s-xfinity.aspx"><img alt="MS Holm Daylight app from Clarity Consulting" class="size-medium wp-image-7534" height="174" src="http://davidcrow.ca/wp-content/uploads/2010/06/daylight_6A96D684-300x174.png" title="daylight_6A96D684" width="300" /></a> <br />
<div class="wp-caption-text">MS Holm Daylight app from Clarity Consulting</div></div>I updated my <a href="http://davidcrow.ca/article/634/open-source-icons">Open Source Icons</a> post earlier to include updated list of icons. The interesting part was this brought up some great mobile design and development resources. With the list of available mobile icons being just the tip of the proverbial iceberg. Speckboy provides a<a href="http://speckyboy.com/2010/04/12/mobile-web-and-app-development-testing-and-emulation-tools/">n unprecedented list of resources</a> for mobile developers and designers it includes: <a href="http://speckyboy.com/2010/05/10/android-app-developers-gui-kits-icons-fonts-and-tools/">Android</a>, <a href="http://speckyboy.com/2010/04/30/iphone-and-ipad-development-gui-kits-stencils-and-icons/">iPhone & iPad</a>, <a href="http://speckyboy.com/2010/04/12/mobile-web-and-app-development-testing-and-emulation-tools/">mobile web & app testing</a>, <a href="http://speckyboy.com/2010/02/17/40-detailed-and-high-quality-mobile-phone-psd-source-files/">.PSDs of different phones</a>, and other mobile platforms.<br />
<h3>Tools</h3><ul><li><a href="http://expression.microsoft.com/en-ca/default.aspx">Expression Studio 4</a></li>
<li><a href="http://www.microsoft.com/expression/products/blend_overview.aspx">Blend 4 for Windows Phone</a></li>
<li><a href="http://developer.windowsphone.com/windows-phone-7/">Visual Studio 2010 & Developer Tools</a></li>
<li><a href="http://sourceforge.net/projects/gitextensions/">GIT Extensions</a> for Visual Studio</li>
</ul><h3>Training Materials</h3><ul><li><a href="http://electricbeach.org/?p=573">Using SketchFlow to Prototype for Windows Phone</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL03">Prototyping RIAs in Silverlight with Expression SketchFlow</a></li>
<li><a href="http://channel9.msdn.com/learn/courses/WP7TrainingKit/">Windows Phone 7 Developer Training Kit</a></li>
<li><a href="http://electricbeach.org/?p=460">Expression Blend for WP7</a></li>
<li><a href="http://www.thewindowsclub.com/windows-phone-7-series-tutorial-building-deploying-applications">Windows Phone 7 Designing, Building & Deploying Tutorials</a> (12 step tutorial)</li>
</ul><h3>UX Guidelines & Tools</h3><div class="wp-caption alignnone" id="attachment_7533" style="width: 300px;"><a href="http://blogs.claritycon.com/blogs/windows_phone_7/archive/2010/04/14/windows-phone-7-design-template.aspx"><img alt="WP7 CS4 Design Template" class="size-medium wp-image-7533" height="225" src="http://davidcrow.ca/wp-content/uploads/2010/06/templatefeatures_0FA58D33-300x225.png" title="WP7 Template" width="300" /></a> <br />
<div class="wp-caption-text">WP7 Design Template for Clarity Consulting</div></div><ul><li><a href="http://go.microsoft.com/?linkid=9713252">UX Guidelines for WP7</a></li>
<li><a href="http://blogs.claritycon.com/blogs/windows_phone_7/archive/2010/04/14/windows-phone-7-design-template.aspx">Windows Phone 7 Design Template</a> (CS4 PSD)</li>
<li><a href="http://blogs.claritycon.com/blogs/windows_phone_7/default.aspx">Clarity Consulting’s WP7 Design Blog</a></li>
</ul><h3>Panorama Navigation</h3><div class="wp-caption alignnone" id="attachment_7532" style="width: 300px;"><a href="http://aimeegurl.com/2010/03/18/panoramic-navigation-on-windows-phone-7-with-no-code/"><img alt="" class="size-medium wp-image-7532" height="135" src="http://davidcrow.ca/wp-content/uploads/2010/06/wp7-games-panorama-300x135.png" title="wp7-games-panorama" width="300" /></a> <br />
<div class="wp-caption-text">Panorama Navigation on Windows Phone 7 </div></div><ul><li><a href="http://blogs.claritycon.com/blogs/design/archive/2010/03/30/building-the-elusive-windows-phone-panorama-control.aspx">Building a Windows Phone Panorama Control</a></li>
<li><a href="http://aimeegurl.com/2010/03/18/panoramic-navigation-on-windows-phone-7-with-no-code/">Panoramic Navigation on Windows Phone 7 with No Code</a></li>
<li><a href="http://phone.codeplex.com/">Panorama and Pivot controls for Windows Phone 7</a></li>
<li><a href="http://blogs.msdn.com/b/stephanc/archive/2010/04/04/windows-phone-7-panorama-control-sample.aspx">WP7 Panorama Sample code</a></li>
</ul><h3>Icons</h3><ul><li><a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2010/03/27/windows-phone-7-series-icon-pack.aspx">Windows Phone 7 Icon Pack</a></li>
<li><a href="http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=369b20f7-9d30-4cff-8a1b-f80901b2da93&displayLang=en">Windows Phone 7 Application Bar Icons</a></li>
</ul>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com1tag:blogger.com,1999:blog-2985194017624312462.post-76344855192911089842010-06-23T09:16:00.000+07:002010-06-23T09:16:56.344+07:00Windows Phone 7 Icons by yankoa<div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-KG8ljaIYWvLfZTejlQJPzk9stVRG7bLiBTNnOcjVgkz2SqderwleQ0A_1zN7qjX9FapxOLGxNEO45NcmuY0JCOhKgtbx5mtkkBLfxHITo9YR9hFp4p0kH8kMk4_Odr7zyATEtArRoIBo/s320/Windows_Phone_7_Icons_by_yankoa.png.jpeg" /></div><br />
Need window phone 7 icons for your applications? Download <a href="http://yankoa.deviantart.com/art/Windows-Phone-7-Icons-166077852">here</a>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-26031816442221038822010-06-15T11:49:00.005+07:002010-06-15T12:04:41.987+07:00Working with Excel in .NetThere are two ways of reading and writing Excel. However, there are some differences between each of them. Sometime i found this helpful but sometime the other is better, so let me try to illustrate two ways in reading Excel file and their pros and cons. <br />
<ol><li><b>Use ADO.NET to Retrieve and Modify Records in an Excel Workbook</b></li>
<ol><ul><li><b>Pros: </b> </li>
</ul><ul><ul><li>Easy to use with ADO.net objects</li>
<li>Easy in loading data into Dataset or Datable, Once we have a Datable, we can use <b>Select</b> method to filtering data.<b> </b></li>
<li>Easy in querying data by using SQL Select Statement</li>
<li>Easy inserting or modifying data by using DataAdapter with SQL Insert and Update statement.</li>
</ul></ul><ul><li><b>Cons</b>:</li>
</ul><ul><ul><li>Provide only basic features with basic purpose (Retrieve and Modify data only)</li>
<li>Not able to format Excel Cell or Range</li>
<li>There is a bug when writing or modifying data in <b>Text</b> type. Text value will be preceded by a single quote (').</li>
<li>In some cases, it cannot read the value of some Cells. It always retrieve Null value, but in fact, the value do exist in the Cells (It happens mostly in formatted Cells)</li>
<li>Not flexible regarding to Table Name. It's required to know Excel's SheetName as TableName to query from.</li>
</ul></ul><ul><li> <b>Connection string: </b></li>
</ul><ul><ul><li><b>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties="Excel 8.0;HDR=YES;" </b></li>
</ul></ul><b> </b>
<ul><ul><ul><li>Excel 8.0 work for Microsoft Excel 8.0 (97), 9.0 (2000), 10.0 (2002) and also 11.0 (2003) </li>
</ul></ul></ul><ul><ul><li> <b><span class="cs_k">Provider</span>=<span class="cs_v">Microsoft.ACE.OLEDB.12.0;</span><span class="cs_k">Data Source</span>=<span class="cs_v">c:\myFolder\myOldExcelFile.xls;</span><span class="cs_k">Extended Properties</span>=<span class="cs_v">"Excel 12.0;HDR=YES";</span></b><br />
</li>
</ul></ul><ul><ul><ul><li>Excel 97-2007 Xls files with ACE OLEDB 12.0<b><span class="cs_v">, </span></b>this connection string to use the Office 2007 OLEDB driver</li>
<li> <b>Note: </b><br />
The quota " in the string needs to be escaped using your language specific escape syntax.<br />
c#, c++ \"<br />
VB6, VBScript ""<br />
xml (web.config etc) "<br />
or maybe use a single quota '. <br />
<br />
"HDR=Yes;" indicates that the first row contains columnnames, not data. "HDR=No;" indicates the opposite.<br />
<br />
"IMEX=1;" tells the driver to always read "intermixed" (numbers, dates, strings etc) data columns as text. Note that this option might affect excel sheet write access negative.</li>
</ul></ul></ul><ul><li><b> Table Naming Conventions</b><br />
There are several ways you can reference a table (or range) in an Excel workbook:</li>
<ul><li>Use the sheet name followed by a dollar sign (for example, [Sheet1$] or [My Worksheet$]). A workbook table that is referenced in this manner includes the whole used range of the worksheet. <br />
<br />
<br />
<div class="indent"><b>Select * from [Sheet1$] </b></div></li>
<li>Use a range with a defined name (for example, [MyNamedRange]): <br />
<br />
<br />
<div class="indent"><b>Select * from [MyNamedRange] </b></div></li>
<li>Use a range with a specific address (for example, [Sheet1$A1:B10]): <br />
<br />
<br />
<div class="indent"><b>Select * from [Sheet1$A1:B10]</b></div></li>
</ul></ul><ul><li><b>Add and Update Records</b> </li>
</ul><ul><ul><li><b>Directly run a command to insert or update records:</b> To do this, you can create an OLEDbCommand object on your connection and set its CommandText property to a valid command to insert records: </li>
</ul></ul><ul><li><b>INSERT INTO [Sheet1$] (F1, F2) values ('111', 'ABC')</b></li>
<li><b>UPDATE [Sheet1$] SET F2 = 'XYZ' WHERE F1 = '111' </b></li>
</ul><b> </b>
<ul><ul><li><b>Make Changes In Dataset/Datable and Use OleDbDataAdapter:</b> </li>
</ul></ul><ul><li>Set OleDbDataAdapter's <b>InsertCommand </b>to: <b>INSERT INTO [Sheet1$] (F1, F2) values (?, ?)</b></li>
<li>Set OleDbDataAdapter's <b>UpdateCommand </b>to: <b>UPDATE [Sheet1$] SET F2 = ? WHERE F1 = ? </b></li>
</ul><ul><ul><li><b>Export data from another data source into an Excel workbook</b> </li>
</ul></ul><ul><ul><ul><li><b> </b>Use OLEDbCommand object, set CommandText property to: <b>INSERT INTO [Sheet1$] IN 'C:\Book1.xls' 'Excel 8.0;' SELECT * FROM MyTable"</b> or <b>SELECT * INTO [Excel 8.0;Database=C:\Book1.xls].[Sheet1] FROM [MyTable] </b> </li>
</ul></ul></ul><ul><li><b>Create Workbooks and Tables</b> </li>
</ul><ul><ul><li><b> To create a table in an Excel workbook, run the CREATE TABLE command: </b></li>
<ul><li><b>CREATE Tjavascript:void(0)ABLE Sheet1 (F1 char(255), F2 char(255))</b> </li>
</ul></ul></ul><ul><li><b>Sample Code</b></li>
<pre>Private m_sConn1 As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\ExcelData1.xls;" & _
"Extended Properties=""Excel 8.0;HDR=YES"""
Private m_sConn2 As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\ExcelData2.xls;" & _
"Extended Properties=""Excel 8.0;HDR=YES"""
Private m_sNorthwind = _
"C:\Program Files\Microsoft Office\Office10\Samples\Northwind.mdb"
Private m_sAction As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
RadioButton1.Text = "Create_Workbook"
RadioButton2.Text = "Retrieve_Records"
RadioButton3.Text = "Add_Records"
RadioButton4.Text = "Update_Records"
RadioButton5.Text = "Update_Individual_Cells"
RadioButton6.Text = "Use_External_Source"
Button1.Text = "Go!"
End Sub
Private Sub RadioButtons_Click(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles RadioButton1.Click, RadioButton2.Click, RadioButton3.Click, _
RadioButton4.Click, RadioButton5.Click, RadioButton6.Click
m_sAction = sender.Text'Store the text for the selected radio button
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
' Call the associated routine to add/update/modify the workbook.
Select Case m_sAction
Case "Create_Workbook" : Create_Workbook()
Case "Retrieve_Records" : Retrieve_Records()
Case "Add_Records" : Add_Records()
Case "Update_Records" : Update_Records()
Case "Update_Individual_Cells" : Update_Individual_Cells()
Case "Use_External_Source" : Use_External_Source()
End Select
Catch ex As OleDbException
Dim er As OleDbError
For Each er In ex.Errors
MsgBox(er.Message)
Next
Catch ex2 As System.InvalidOperationException
MsgBox(ex2.Message)
End Try
End Sub
Public Sub Create_Workbook()
' If the workbooks already exist, prompt to delete.
Dim answer As MsgBoxResult
If Dir("C:\ExcelData1.xls") <> "" Or Dir("C:\ExcelData2.xls") <> "" Then
answer = MsgBox("Delete existing workbooks (C:\ExcelData1.xls and " & _
"C:\ExcelData2.xls)?", MsgBoxStyle.YesNo)
If answer = MsgBoxResult.Yes Then
If Dir("C:\ExcelData1.xls") <> "" Then Kill("C:\ExcelData1.xls")
If Dir("C:\ExcelData2.xls") <> "" Then Kill("C:\ExcelData2.xls")
Else
Exit Sub
End If
End If
'==========================================================================
' Create a workbook with a table named EmployeeData. The table has 3
' fields: ID (char 255), Name (char 255) and Birthdate (date).
'==========================================================================
Dim conn As New OleDbConnection()
conn.ConnectionString = m_sConn1
conn.Open()
Dim cmd1 As New OleDbCommand()
cmd1.Connection = conn
cmd1.CommandText = "CREATE TABLE EmployeeData (Id char(255), Name char(255), BirthDate date)"
cmd1.ExecuteNonQuery()
cmd1.CommandText = "INSERT INTO EmployeeData (Id, Name, BirthDate) values ('AAA', 'Andrew', '12/4/1955')"
cmd1.ExecuteNonQuery()
conn.Close()
'==========================================================================
' Create a workbook with a table named InventoryData. The table has 3
' fields: Product (char 255), Qty (float) and Price (currency).
'==========================================================================
conn.ConnectionString = m_sConn2
conn.Open()
Dim cmd2 As New OleDbCommand()
cmd2.Connection = conn
cmd2.CommandText = "CREATE TABLE InventoryData (Product char(255), Qty float, Price currency)"
cmd2.ExecuteNonQuery()
cmd2.CommandText = "INSERT INTO InventoryData (Product, Qty, Price) values ('Cola', 200, 1.35)"
cmd2.ExecuteNonQuery()
cmd2.CommandText = "INSERT INTO InventoryData (Product, Qty, Price) values ('Chips', 550, 0.89)"
cmd2.ExecuteNonQuery()
conn.Close()
' NOTE: You can ALTER and DROP tables in a similar fashion.
End Sub
Public Sub Retrieve_Records()
'==========================================================
'Use a DataReader to read data from the EmployeeData table.
'==========================================================
Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1)
conn1.Open()
Dim cmd1 As New System.Data.OleDb.OleDbCommand("Select * From [EmployeeData$]", conn1)
Dim rdr As OleDbDataReader = cmd1.ExecuteReader
Debug.WriteLine(vbCrLf & "EmployeeData:" & vbCrLf & "=============")
Do While rdr.Read()
Debug.WriteLine(System.String.Format("{0,-10}{1, -15}{2}", _
rdr.GetString(0), rdr.GetString(1), _
rdr.GetDateTime(2).ToString("d")))
Loop
rdr.Close()
conn1.Close()
'========================================================
'Use a DataSet to read data from the InventoryData table.
'========================================================
Dim conn2 As New OleDbConnection(m_sConn2)
Dim da As New OleDbDataAdapter("Select * From [InventoryData$]", conn2)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
Debug.WriteLine(vbCrLf & "InventoryData:" & vbCrLf & "==============")
Dim dr As DataRow
For Each dr In ds.Tables(0).Rows'Show results in output window
Debug.WriteLine(System.String.Format("{0,-15}{1, -6}{2}", _
dr("Product"), dr("Qty"), dr("Price")))
Next
conn2.Close()
End Sub
Public Sub Add_Records()
'==========================================================================
' Run an INSERT INTO command to add new records to the workbook.
'==========================================================================
Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1)
conn1.Open()
Dim cmd As New System.Data.OleDb.OleDbCommand()
cmd.Connection = conn1
cmd.CommandText = "INSERT INTO [EmployeeData$] (ID, Name, BirthDate) values ('CCC', 'Charlie', '10/14/48')"
cmd.ExecuteNonQuery()
cmd.CommandText = "INSERT INTO [EmployeeData$] (ID, Name, BirthDate) values ('DDD', 'Deloris', '7/19/98')"
cmd.ExecuteNonQuery()
conn1.Close()
'====================================================================
'Use the InsertCommand object to add new records to the InventoryData
'table.
'====================================================================
Dim conn2 As New OleDbConnection(m_sConn2)
Dim da As New OleDbDataAdapter("Select * From [InventoryData$]", conn2)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "MyExcelTable")
' Generate the InsertCommand and add the parameters for the command.
da.InsertCommand = New OleDbCommand( _
"INSERT INTO [InventoryData$] (Product, Qty, Price) VALUES (?, ?, ?)", conn2)
da.InsertCommand.Parameters.Add("@Product", OleDbType.VarChar, 255, "Product")
da.InsertCommand.Parameters.Add("@Qty", OleDbType.Double).SourceColumn = "Qty"
da.InsertCommand.Parameters.Add("@Price", OleDbType.Currency).SourceColumn = "Price"
' Add two new records to the dataset.
Dim dr As DataRow
dr = ds.Tables(0).NewRow
dr("Product") = "Bread" : dr("Qty") = 390 : dr("Price") = 1.89 : ds.Tables(0).Rows.Add(dr)
dr = ds.Tables(0).NewRow
dr("Product") = "Milk" : dr("Qty") = 99 : dr("Price") = 2.59 : ds.Tables(0).Rows.Add(dr)
' Apply the dataset changes to the actual data source (the workbook).
da.Update(ds, "MyExcelTable")
conn2.Close()
End Sub
Public Sub Update_Records()
'==========================================================================
' Run an UPDATE command to change a record in the EmployeeData
' table.
'==========================================================================
Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1)
conn1.Open()
Dim cmd As New System.Data.OleDb.OleDbCommand()
cmd.Connection = conn1
cmd.CommandText = "UPDATE [EmployeeData$] " & _
"SET NAME = 'Aaron', BirthDate = '5/4/1975' WHERE ID = 'AAA'"
cmd.ExecuteNonQuery()
conn1.Close()
'====================================================================
' Use the UpdateCommand object to modify records in the InventoryData
' table.
'====================================================================
Dim conn2 As New OleDbConnection(m_sConn2)
Dim da As New OleDbDataAdapter("Select * From [InventoryData$]", conn2)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "MyInventoryTable")
' Generate the UpdateCommand and add the parameters for the command.
da.UpdateCommand = New OleDbCommand( _
"UPDATE [InventoryData$] SET Qty = ?, Price=? WHERE Product = ?", conn2)
da.UpdateCommand.Parameters.Add("@Qty", OleDbType.Numeric).SourceColumn = "Qty"
da.UpdateCommand.Parameters.Add("@Price", OleDbType.Currency).SourceColumn = "Price"
da.UpdateCommand.Parameters.Add("@Product", OleDbType.VarChar, 255, "Product")
' Update the first two records.
ds.Tables(0).Rows(0)("Qty") = 1000
ds.Tables(0).Rows(0)("Price") = 10.1
ds.Tables(0).Rows(1)("Qty") = 2000
ds.Tables(0).Rows(1)("Price") = 20.2
' Apply the dataset changes to the actual data source (the workbook).
da.Update(ds, "MyInventoryTable")
conn2.Close()
End Sub
Public Sub Update_Individual_Cells()
'==========================================================================
' Update individual cells on the EmployeeData worksheet;
' specifically, cells F3, G3, and I4 are modified.
'==========================================================================
' NOTE: The connection string indicates that the table does *NOT*
' have a header row.
Dim conn As New System.Data.OleDb.OleDbConnection(m_sConn1.Replace("HDR=YES", "HDR=NO"))
conn.Open()
Dim cmd As New System.Data.OleDb.OleDbCommand()
cmd.Connection = conn
cmd.CommandText = "UPDATE [EmployeeData$F3:G3] SET F1 = 'Cell F3', F2 = 'Cell G3'"
cmd.ExecuteNonQuery()
cmd.CommandText = "UPDATE [EmployeeData$I4:I4] SET F1 = 'Cell I4'"
cmd.ExecuteNonQuery()
conn.Close()
End Sub
Public Sub Use_External_Source()
' Open a connection to the sample Northwind Access database.
Dim conn As New System.Data.OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & m_sNorthwind & ";")
conn.Open()
Dim cmd As New System.Data.OleDb.OleDbCommand()
cmd.Connection = conn
'=======================================================================
' Run an INSERT..INTO command on the Northwind database to append
' the records from a table/query to an existing table in the Excel
' workbook.
'=======================================================================
cmd.CommandText = "INSERT INTO [EmployeeData$] IN 'C:\ExcelData1.xls' 'Excel 8.0;'" & _
"SELECT EmployeeID AS ID, FirstName AS Name, BirthDate FROM Employees"
cmd.ExecuteNonQuery()
'==========================================================================
' Run a SELECT..INTO command on the Northwind database to insert
' all the records from a table/query into a new sheet in the Excel
' workbook.
'==========================================================================
cmd.CommandText = "SELECT * INTO [Excel 8.0;Database=C:\ExcelData2.xls].[ProductSales]" & _
"FROM [Product Sales for 1997]"
cmd.ExecuteNonQuery()
conn.Close()
End Sub </pre><pre> </pre>
<li><b>Extra Source Code:</b></li>
</ul></ol><b> </b>
<ol><ul><ul><li><b>Get Excel SheetName: </b></li>
<pre>private String[] GetExcelSheetNames(string excelFile)
{
OleDbConnection objConn = null;
System.Data.DataTable dt = null;
try
{
// Connection String. Change the excel file to the file you
// will search.
String connString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + excelFile + ";Extended Properties=Excel 8.0;";
// Create connection object by using the preceding connection string.
objConn = new OleDbConnection(connString);
// Open connection with the database.
objConn.Open();
// Get the data table containg the schema guid.
dt = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if(dt == null)
{
return null;
}
String[] excelSheets = new String[dt.Rows.Count];
int i = 0;
// Add the sheet name to the string array.
foreach(DataRow row in dt.Rows)
{
excelSheets[i] = row["TABLE_NAME"].ToString();
i++;
}
// Loop through all of the sheets if you want too...
for(int j=0; j < excelSheets.Length; j++)
{
// Query each excel sheet.
}
return excelSheets;
}
catch(Exception ex)
{
return null;
}
finally
{
// Clean up.
if(objConn != null)
{
objConn.Close();
objConn.Dispose();
}
if(dt != null)
{
dt.Dispose();
}
}
}
References:
<a href="http://support.microsoft.com/kb/316934">http://support.microsoft.com/kb/316934</a></pre><pre><a href="http://www.connectionstrings.com/excel">http://www.connectionstrings.com/excel</a> </pre><pre></pre></ul></ul></ol>
<li><b>Using Excel Object Library</b></li>
</ol>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-23862101789290696082010-06-08T09:41:00.000+07:002010-06-08T09:41:53.803+07:00Import Textfile(.txt) to an existing excel fileThe following uses ADO.NET to import into an existing Excel Worksheet named ReportSheet. The source<br />
text file is ReportFile.txt.<br />
<br />
Function ImportTextToExcel() As Boolean<br />
<br />
Dim ExcelConnection As New<br />
System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source=e:\My Documents\Book20.xls;Extended Properties=""Excel 8.0;HDR=NO;""")<br />
<br />
ExcelConnection.Open()<br />
<br />
Dim ImportCommand As New System.Data.OleDb.OleDbCommand("INSERT INTO [ReportSheet] (F1, F2,<br />
F3, F4, F5, F6, F7, F8, F9, F10) SELECT * FROM [Text;HDR=NO;DATABASE=E:\My<br />
Documents\TextFiles].[ReportFile.txt]", ExcelConnection)<br />
<br />
ImportCommand.ExecuteNonQuery()<br />
ExcelConnection.Close()<br />
<br />
End FunctionSavot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-2851703960641918952010-06-08T08:42:00.000+07:002010-06-08T08:42:18.670+07:00Another contest of Window Phone 7Got a great idea for an app, but no programming skills? Microsoft has a new contest going on where you can send them some great application ideas... Then everyone else votes on which application sounds the best. Whomever wins gets their application built and made available for free on the Windows Phone 7 Marketplace. You also get $5000 and a Windows Phone 7 device. For more information and to enter, visit WindowsPhone7.com/INeedThisApp/<br />
<br />
I've already entered one of my ideas. What do you think? Feel free to vote for it, even though it's highly unlikely that Microsoft would even be able to build that one by December.Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-68884856033286607982010-04-02T09:19:00.000+07:002010-04-02T09:19:21.536+07:00Develop games on the Window Phone 7 SeriesWant to develop game on Window Phone 7 Series? Quick! Quick! Be the first of all to get yourself around the new OS. Guys from channel9 have created a tutorial on how to create game running on the platform. <br />
<br />
Here is the table of content:<br />
<br />
<a href="http://channel9.msdn.com/learn/courses/WP7TrainingKit/WP7XNA/GameDevelopmentWithXNALab/Overview">Overview</a><br />
<br />
<a href="http://channel9.msdn.com/learn/courses/WP7TrainingKit/WP7XNA/GameDevelopmentWithXNALab/Exercise-1-XNA-Games-on-the-Windows-Phone-7-Series">Exercise 1: XNA Games on the Windows Phone 7 Series</a><br />
o <a href="http://channel9.msdn.com/learn/courses/WP7TrainingKit/WP7XNA/GameDevelopmentWithXNALab/Exercise-1-XNA-Games-on-the-Windows-Phone-7-Series#_Toc256074919">Task 1 – Game Basics</a><br />
o <a href="http://channel9.msdn.com/learn/courses/WP7TrainingKit/WP7XNA/GameDevelopmentWithXNALab/Exercise-1-XNA-Games-on-the-Windows-Phone-7-Series#_Toc256074920">Task 2 – Game Resources</a><br />
o <a href="http://channel9.msdn.com/learn/courses/WP7TrainingKit/WP7XNA/GameDevelopmentWithXNALab/Exercise-1-XNA-Games-on-the-Windows-Phone-7-Series#_Toc256074921">Task 3 – Game Loop</a><br />
o <a href="http://channel9.msdn.com/learn/courses/WP7TrainingKit/WP7XNA/GameDevelopmentWithXNALab/Exercise-1-XNA-Games-on-the-Windows-Phone-7-Series#_Toc256074922">Task 4 – Game Input</a><br />
o <a href="http://channel9.msdn.com/learn/courses/WP7TrainingKit/WP7XNA/GameDevelopmentWithXNALab/Exercise-1-XNA-Games-on-the-Windows-Phone-7-Series#_Toc256074923">Task 5 – Alien Game Logic</a><br />
<br />
<a href="http://channel9.msdn.com/learn/courses/WP7TrainingKit/WP7XNA/GameDevelopmentWithXNALab/Summary">Summary</a><br />
<br />
There is also Window Phone Series "Rockstar" Awards will be given away to the developer team who win the competition range from first prize to third prize. <br />
<br />
Award Finalists receive:<br />
<br />
* First Prize: $8,000 USD, a trip to the Worldwide Finals in Warsaw, Poland from July 3-8, 2010, and a Windows Phone for each team member.<br />
* Second Prize: $4,000 USD and a Windows Phone for each team member<br />
* Third Prize: $3,000 USD and a Windows Phone for each team member<br />
<br />
Deadline for application entry: <b>May 24, 2010 at 11:59 P.M. GMT.</b><br />
<br />
Detail info and how to register: go to <a href="http://www.1800pocketpc.com/2010/03/31/windows-phone-7-series-rockstar-award-8000-up-for-grabs.html#more-11873">here</a><br />
<br />
Let me know if you are interested. I am thinking to build a team for this competition.Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com2tag:blogger.com,1999:blog-2985194017624312462.post-35026166099798510342010-03-24T10:02:00.001+07:002010-03-26T09:25:55.137+07:00Count total number of pages in pdf file (C#)It is actually a simple solution to get a total number of pages in pdf file. I found it from devasp and I think it's worth to share. <br />
<br />
using System.IO;<br />
using System.Text.RegularExpressions;<br />
<br />
public static int GetNoOfPagesPDF(string FileName)<br />
<br />
{<br />
int result = 0;<br />
<br />
FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);<br />
<br />
StreamReader r = new StreamReader(fs);<br />
<br />
string pdfText = r.ReadToEnd();<br />
<br />
System.Text.RegularExpressions.Regex regx = new Regex(@"/Type\s*/Page[^s]");<br />
<br />
System.Text.RegularExpressions.MatchCollection matches = regx.Matches(pdfText);<br />
<br />
result = matches.Count;<br />
<br />
return result;<br />
}Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com1tag:blogger.com,1999:blog-2985194017624312462.post-1111555357680371262010-03-16T15:14:00.000+07:002010-03-16T15:14:06.362+07:00Window Phone 7 Series Development ToolsIn this Mix10 event, Microsoft has released a set of development tools for Window Phone 7 Series. <br />
<br />
The Windows Phone Developer Tools CTP includes the following<br />
<br />
<br />
Visual Studio 2010 Express for Windows Phone CTP<br />
<br />
Windows Phone Emulator CTP<br />
<br />
Silverlight for Windows Phone CTP<br />
<br />
XNA 4.0 Game Studio CTP<br />
<br />
<br />
Download <a href="http://developer.windowsphone.com/windows-phone-7-series/">here</a>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-43355866409103800742010-03-12T13:29:00.000+07:002010-03-12T13:29:39.620+07:00Android on HTC Window Mobile PhoneThe XDAndroid project, Android Mobile OS for Window Mobile-Based HTC devices, has progressed tremendously and has archived many great performances for lots of Window-Mobile-Based devices to work with Android platform (<span style="font-size: x-small;">sorry for HTC-HD2 users. Base on my understanding no any Android version working on HTC HD2 yet because of device driver issue</span>). In the previous release, not many components worked, but in the recent release guys from pocketnow has tested with HTC touch pro and it works with call, sms, data.<br />
<br />
Checkout the following links to get Android platform installed on your specific device.<br />
<br />
<b>Android on HTC Windows Phones:</b> <br />
<br />
• <a href="http://forum.xda-developers.com/showthread.php?t=627997">Touch Pro2 (GSM)</a> <br />
• <a href="http://forum.ppcgeeks.com/showthread.php?t=113373">Touch Pro2 (CDMA - must take SIM card out)</a><br />
• <a href="http://forum.xda-developers.com/showthread.php?t=509493">Touch Diamond2/Pure</a> <br />
• <a href="http://forum.xda-developers.com/showthread.php?t=621498">Touch HD</a> <br />
• <a href="http://forum.xda-developers.com/showthread.php?t=601751">Touch Pro/Fuze (GSM)</a> <br />
• <a href="http://forum.ppcgeeks.com/showthread.php?t=104276">Touch Pro (CDMA)</a> <br />
• <a href="http://forum.xda-developers.com/showthread.php?t=586386">Touch Diamond (GSM)</a> <br />
• <a href="http://forum.xda-developers.com/showthread.php?p=5222958">Touch Diamond (CDMA)</a> <br />
<br />
<br />
Via: <a href="http://pocketnow.com/tweaks-hacks/android-update-on-the-touch-pro2-it-rocks">pocketnow</a>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-7359254055918400642010-03-10T09:02:00.001+07:002010-03-26T09:26:42.029+07:00Android Development Kits Hits Several New UpdateAt the same time of the announcement of Window Phone Series 7 which seems to rock the mobile market so much, Google Android is also working hard with its platform to bring developers realistic development features for their mobile development market. <br />
<br />
The release of several update of development kits I believe will make the platform become more interesting to mobile companies and developers. <br />
<br />
Below are several new update of development kit of Android in this March-2010.<br />
<br />
- <span style="font-weight:bold;">ADT 0.9.6:</span> ADT Plugin for Eclipse hit version 0.9.6<br />
<br />
- <span style="font-weight:bold;">Android SDK, R5:</span> The pakage include SDK Tools which provide developer the Development and Debugging Tools. If you are using the old version of SDK tools and want to upgrade to the new version, no need to download the whole SDK package again. You can just update the SDK tools by using the <span style="font-weight:bold;">Android SDK and AVD Manager (via Eclipse or run "SDK Setup.exe" under SDK package folder)</span><br />
<br />
- <span style="font-weight:bold;">Android NDK,r3:</span> Known as Android Native Development Kit currently hit Revision 3, bring new support for OpenGL ES 2.0 native library, will bring a new generation of fantastic 2D and 3D games like what we've seen in IPhone. NDK is used conjunction with Android SDK which mean we need to have Android SDK installed and you will likely use C/C++ language for coding. <br />
<br />
Read more: <a href="http://developer.android.com/sdk/ndk/index.html">http://developer.android.com</a>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-79599848781832213052010-03-02T15:03:00.000+07:002010-03-02T17:32:43.088+07:00Regular Expression Examples<span style="font-weight: bold;">Regex to get Class Name from CSS content:</span><br /><br /><u>Regex:</u> <span style="font-style: italic;">\.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*</span><br /><br /><u>Input:</u><br /><br />.center {text-align: center;}<br />.smcap {font-variant: small-caps;}<br />.u {text-decoration: underline;}<br /><br />#body { ...}<br /><br /><u>Output:</u><br /><br />.center<br />.smcap<br />.u<br /><br /><span style="font-weight: bold;">Regex to get all element from CSS content:</span><br /><br /><u>Regex:</u> <span style="font-style: italic;">\.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*</span><br /><br /><u>Input:</u><br /><br />.center {text-align: center;}<br />.smcap {font-variant: small-caps;}<br />.u {text-decoration: underline;}<br />#body { ...}<br />div.test div.yoyo {...}<br /><br /><u>Output:</u><br /><br />.center<br />.smcap<br />.u<br />#body<br />div.test div.yoyo<br /><br /><span style="font-weight: bold;">Regex to get HTML element and its content</span><br /><br /><u>Regex:</u><br /><br /><span\b[^>]*>(.*?)</span><br />(wrong in case this: <span>one<span>two</span>one</span>).<br /><br />and<br /><br /><span\b[^>]*>(?:(?=([^<]+))\1|<(?!table\b[^>]*>))*?</span><br /><br /><u>Input:</u><br /><br /><p><span><a name="bookmark1" />dirt farmer's son</span></p><br /><br /><u>Output:</u><br /><br /><span><a name="bookmark1" />dirt farmer's son</span>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-63057051508639835922010-02-22T15:19:00.000+07:002010-02-22T15:26:00.114+07:00Cross browser object check<span style="font-weight:bold;">HTML</span><br /><br /><input type="button" onclick="handleViewHTMLContent(event);" id="button1" value="View Content" style="float: right;"><br /><br /><input type="button" onclick="handleViewHTMLContent(event);" id="button2" value="View Content" style="float: right;"><br /><br /><br /><span style="font-weight:bold;">Javascript</span><br /><br />...<br />function handleViewHTMLContent(event) {<br /> var button = event.srcElement || event.currentTarget; //IE : Firefox<br /> alert(button.id);<br />}Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-45373772725635746872009-10-28T16:39:00.000+07:002009-10-28T17:00:35.415+07:00Design Interaction on your website in just a minute by using a JQuery Base tool<span style="font-weight:bold;">Background:</span><br /><br />IxEdit is a JavaScript-based interaction design tool for the web which is implemented base on JQuery. <br /><br /><span style="font-weight:bold;">Why use this tool?</span><br /><br />This tool can help use to design interaction to a website visually on the site itself and then generate JQuery codes. Finally, all you need to do is to copy the codes and do implement your main code. <br /><br /><span style="font-weight:bold;">See a video demo:</span><br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/9n_E556-8xI&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9n_E556-8xI&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /><a href="http://www.ixedit.com/">http://www.ixedit.com/</a>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com1tag:blogger.com,1999:blog-2985194017624312462.post-82337913928082411232009-10-22T15:39:00.000+07:002009-10-22T15:40:17.024+07:00Fancy Form Design Using CSShttp://articles.sitepoint.com/article/fancy-form-design-cssSavot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com1tag:blogger.com,1999:blog-2985194017624312462.post-19549280203409673672009-10-22T15:38:00.000+07:002009-10-22T15:39:11.112+07:00CSS and Round Corners: Build Boxes with Curveshttp://articles.sitepoint.com/article/css-round-corners-boxes-curvesSavot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-66309132064348141762009-10-09T10:18:00.000+07:002009-10-09T10:19:30.908+07:00Agile Project Management Tools (Open Source Project)<a href="http://www.agile-tools.net/">www.agile-tools.net</a>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com1tag:blogger.com,1999:blog-2985194017624312462.post-90704384285788523122009-10-09T10:05:00.000+07:002009-10-09T10:07:30.904+07:00Agile Project Management Tool<strong>Bright Green Projects</strong> is an application to capture and prioritise requirements, build estimates, manage iterations, track issues and deliver shippable software to your happy customers.<br /><br /><a href="http://www.brightgreenprojects.com/">www.brightgreenprojects.com</a>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com1tag:blogger.com,1999:blog-2985194017624312462.post-13471288029850296752009-10-08T09:08:00.000+07:002009-10-08T09:09:03.534+07:00Use NetSpell (Spell check) in your ASP.NET 2.0 applicationhttp://www.aspcode.net/Use-NetSpell-in-your-ASPNET-20-application.aspxSavot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0tag:blogger.com,1999:blog-2985194017624312462.post-61244766231684193752009-09-22T09:45:00.000+07:002009-09-22T10:54:54.568+07:00Xpath Example<DIV id="mainBody"><br /><P>This topic reviews the syntax examples that appear throughout the XPath Reference. All are based on the Sample XML File for XPath Syntax (inventory.xml). For an example of using an XPath expression in a test file, see "Example of Unions ( | )", at the bottom of this topic.</P><br /><DIV class="seeAlsoNoToggleSection" id="sectionSection0"><br /><DIV class="tableSection"><br /><TABLE cellSpacing="2" cellPadding="5" width="100%"><br /><TBODY><TR><TH>Expression </TH><TH>Refers to </TH></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><br /><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode"><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>./author</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements within the current context. Note that this is equivalent to the expression in the next row.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode"><IMG class="copyCodeImage" alt="Copy image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements within the current context.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="Copy image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>first.name</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><first.name></CODE> elements within the current context.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>/bookstore</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The document element (<CODE><bookstore></CODE>) of this document.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>//author</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements in the document.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book[/bookstore/@specialty = @style]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><book></CODE> elements whose <CODE>style</CODE> attribute value is equal to the <CODE>specialty</CODE> attribute value of the <CODE><bookstore></CODE> element at the root of the document.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author/first-name</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><first-name></CODE> elements that are children of an <CODE><author></CODE> element.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>bookstore//title</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><title></CODE> elements one or more levels deep in the <CODE><bookstore></CODE> element (arbitrary descendants). Note that this is different from the expression in the next row.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>bookstore/*/title</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><title></CODE> elements that are grandchildren of <CODE><bookstore></CODE> elements.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>bookstore//book/excerpt//emph</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><emph></CODE> elements anywhere inside <CODE><excerpt></CODE> children of <CODE><book></CODE> elements, anywhere inside the <CODE><bookstore></CODE> element.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>.//title</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><title></CODE> elements one or more levels deep in the current context. Note that this situation is essentially the only one in which the period notation is required.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author/*</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All elements that are the children of <CODE><author></CODE> elements.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book/*/last-name</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><last-name></CODE> elements that are grandchildren of <CODE><book></CODE> elements.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>*/*</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All grandchildren elements of the current context.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>*[@specialty]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All elements with the <CODE>specialty</CODE> attribute.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>@style</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The <CODE>style</CODE> attribute of the current context.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>price/@exchange</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The <CODE>exchange</CODE> attribute on <CODE><price></CODE> elements within the current context.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>price/@exchange/total</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>Returns an empty node set, because attributes do not contain element children. This expression is allowed by the XML Path Language (XPath) grammar, but is not strictly valid.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book[@style]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><book></CODE> elements with <CODE>style</CODE> attributes, of the current context.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="Copy image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book/@style</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The <CODE>style</CODE> attribute for all <CODE><book></CODE> elements of the current context.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>@*</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All attributes of the current element context.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>./first-name</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><first-name></CODE> elements in the current context node. Note that this is equivalent to the expression in the next row.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>first-name</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><first-name></CODE> elements in the current context node.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[1]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The first <CODE><author></CODE> element in the current context node.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[first-name][3]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The third <CODE><author></CODE> element that has a <CODE><first-name></CODE> child.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="Copy image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>my:book</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The <CODE><book></CODE> element from the <CODE>my</CODE> namespace.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>my:*</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All elements from the <CODE>my</CODE> namespace.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>@my:*</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All attributes from the <CODE>my</CODE> namespace (this does not include unqualified attributes on elements from the <CODE>my</CODE> namespace).</P></TD></TR></TBODY></TABLE></DIV><P>Note that indexes are relative to the parent. Consider the following data:</P><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE><x> <y/> <y/></x><x> <y/> <y/></x></PRE></TD></TR></TBODY></TABLE></SPAN></DIV><DIV class="labelheading"><B></B></DIV><DIV class="tableSection"><TABLE cellSpacing="2" cellPadding="5" width="100%"><TBODY><TR><TH>Expression </TH><TH>Refers to </TH></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>x/y[1]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The first <CODE><y></CODE> child of each <CODE><x></CODE>. This is equivalent to the expression in the next row.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>x/y[position() = 1]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The first <CODE><y></CODE> child of each <CODE><x></CODE>.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="Copy image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>(x/y)[1]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The first <CODE><y></CODE> from the entire set of <CODE><y></CODE> children of <CODE><x></CODE> elements.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>x[1]/y[2]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The second <CODE><y></CODE> child of the first <CODE><x></CODE>.</P></TD></TR></TBODY></TABLE></DIV><P>The remaining examples refer to the Sample XML file for XPath.</P><DIV class="labelheading"><B></B></DIV><DIV class="tableSection"><TABLE cellSpacing="2" cellPadding="5" width="100%"><TBODY><TR><TH>Expression </TH><TH>Refers to </TH></TR><TR><TD><P><CODE>book[last()]</CODE> </P></TD><TD><P>The last <CODE><book></CODE> element of the current context node.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book/author[last()]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The last <CODE><author></CODE> child of each <CODE><book></CODE> element of the current context node.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>(book/author)[last()]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The last <CODE><author></CODE> element from the entire set of <CODE><author></CODE> children of <CODE><book></CODE> elements of the current context node.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book[excerpt]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><book></CODE> elements that contain at least one <CODE><excerpt></CODE> element child.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book[excerpt]/title</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><title></CODE> elements that are children of <CODE><book></CODE> elements that also contain at least one <CODE><excerpt></CODE> element child.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book[excerpt]/author[degree]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that contain at least one <CODE><degree></CODE> element child, and that are children of <CODE><book></CODE> elements that also contain at least one <CODE><excerpt></CODE> element. </P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book[author/degree]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><book></CODE> elements that contain <CODE><author></CODE> children that in turn contain at least one <CODE><degree></CODE> child.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[degree][award]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that contain at least one <CODE><degree></CODE> element child and at least one <CODE><award></CODE> element child.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="Copy image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[degree and award]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that contain at least one <CODE><degree></CODE> element child and at least one <CODE><award></CODE> element child.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[(degree or award) and publication]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that contain at least one <CODE><degree></CODE> or <CODE><award></CODE> and at least one <CODE><publication></CODE> as the children</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[degree and not(publication)]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that contain at least one <CODE><degree></CODE> element child and that contain no <CODE><publication></CODE> element children.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[not(degree or award) and publication]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that contain at least one <CODE><publication></CODE> element child and contain neither <CODE><degree></CODE> nor <CODE><award></CODE> element children.</P></TD></TR><TR><TD><P><CODE>author[last-name = "Bob"]</CODE> </P></TD><TD><P>All <CODE><author></CODE> elements that contain at least one <CODE><last-name></CODE> element child with the value <CODE>Bob</CODE>.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[last-name[1] = "Bob"]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements where the first <CODE><last-name></CODE> child element has the value <CODE>Bob</CODE>. Note that this is equivalent to the expression in the next row.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[last-name [position()=1]= "Bob"]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements where the first <CODE><last-name></CODE> child element has the value <CODE>Bob</CODE>.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>degree[@from != "Harvard"]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><degree></CODE> elements where the <CODE>from</CODE> attribute is not equal to <CODE>"Harvard"</CODE>.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[. = "Matthew Bob"]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements whose value is <CODE>Matthew Bob</CODE>.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[last-name = "Bob" and ../price &gt; 50]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that contain a <CODE><last-name></CODE> child element whose value is <CODE>Bob</CODE>, and a <CODE><price></CODE> sibling element whose value is greater than 50. </P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>book[position() &lt;= 3]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The first three books (1, 2, 3).</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[not(last-name = "Bob")]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that do no contain <CODE><last-name></CODE> child elements with the value <CODE>Bob</CODE>.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[first-name = "Bob"]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that have at least one <CODE><first-name></CODE> child with the value <CODE>Bob</CODE>. </P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[* = "Bob"]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>all author elements containing any child element whose value is <CODE>Bob</CODE>. </P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>author[last-name = "Bob" and first-name = "Joe"]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><author></CODE> elements that has a <CODE><last-name></CODE> child element with the value <CODE>Bob</CODE> and a <CODE><first-name></CODE> child element with the value <CODE>Joe</CODE>.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>price[@intl = "Canada"]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>All <CODE><price></CODE> elements in the context node which have an <CODE>intl</CODE> attribute equal to <CODE>"Canada"</CODE>.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>degree[position() &lt; 3]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The first two <CODE><degree></CODE> elements that are children of the context node.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>p/text()[2]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The second text node in each <CODE><p></CODE> element in the context node.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>ancestor::book[1]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The nearest <CODE><book></CODE> ancestor of the context node.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>ancestor::book[author][1]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The nearest <CODE><book></CODE> ancestor of the context node and this <CODE><book></CODE> element has an <CODE><author></CODE> element as its child.</P></TD></TR><TR><TD><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE>ancestor::author[parent::book][1]</PRE></TD></TR></TBODY></TABLE></SPAN></DIV></TD><TD><P>The nearest <CODE><author></CODE> ancestor in the current context and this <CODE><author></CODE> element is a child of a <CODE><book></CODE> element.</P></TD></TR></TBODY></TABLE></DIV></DIV><H1 class="heading">Example of Unions ( | )</H1><DIV class="section" id="sectionSection1" name="collapseableSection"><P>To demonstrate the union operation, we use the following XPath expression: </P><P><CODE>x | y/x</CODE> </P><P>selects all the <x> elements whose values are <I>green</I> or <I>blue</I> in the following XML file:</P><SECTIONS xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></SECTIONS><H3 class="subHeading" xmlns="">XML File (data1.xml)</H3><DIV class="subSection" xmlns=""><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE><?xml version='1.0'?><?xml-stylesheet type="text/xsl" href="union.xsl"?><root> <x>green</x> <y> <x>blue</x> <x>blue</x> </y> <z> <x>red</x> <x>red</x> </z> <x>green</x></root></PRE></TD></TR></TBODY></TABLE></SPAN></DIV></DIV><H3 class="subHeading" xmlns="">XSLT File (union.xsl)</H3><DIV class="subSection" xmlns=""><DIV class="code"><SPAN codeLanguage="xml"><TABLE cellSpacing="0" cellPadding="0" width="100%"><TBODY><TR><TH>Xml </TH><TH><SPAN class="copyCode" ><IMG class="copyCodeImage" alt="CopyCode image" src="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/WD_XMLStd/local/copycode.gif" align="absMiddle" name="ccImage" /></IMG><//IMG>Copy Code</SPAN></TH></TR><TR><TD colSpan="2"><PRE><?xml version='1.0'?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="root"> <xsl:for-each select="x | y/x"> <xsl:value-of select="."/>, <xsl:if test="not(position()=last())">,</xsl:if> </xsl:for-each></xsl:template> </xsl:stylesheet></PRE></TD></TR></TBODY></TABLE></SPAN></DIV><SECTIONS xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></SECTIONS><H4 class="subHeading" xmlns="">Formatted Output</H4><DIV class="subSection" xmlns=""><P>green,blue,blue,green</P></DIV><H4 class="subHeading" xmlns="">Processor Output</H4><DIV class="subSection" xmlns=""><P><CODE><?xml version="1.0" encoding="UTF-16"?>green,blue,blue,green</CODE> </P></DIV></SECTIONS><//SECTIONS></DIV></SECTIONS><//SECTIONS></DIV></DIV>Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com1tag:blogger.com,1999:blog-2985194017624312462.post-87070996997330151732009-09-07T14:06:00.001+07:002009-09-07T14:30:19.126+07:00Get files with multiple extension from a directoryBackgroud:<br /><br /><strong>System.IO.Directory</strong> class provide a method <strong>GetFiles(...)</strong> to get a list of files from a directory. But, there is a limitation if programmers want to code to get a list of files with multiple extension provided.<br /><br />Solution:<br /><br />In order to get this done, I come up with a simple solution to create a method with 3 parametters.<br /><br />Method:<br /><code><br />public static string[] getFilesWithMultipleExtensions(string path, string extensionList, string delimeter)<br />{<br />System.Collections.Generic.List<string> strFiles = new System.Collections.Generic.List<string>();<br /><br />foreach (string strExt in extensionList.Split(delimeter.ToCharArray()))<br />{<br />strFiles.AddRange(Directory.GetFiles(path, strExt));<br />}<br />return strFiles.ToArray();<br />}<br /></code><br /><br /><br /><br />Usage: <br />getFilesWithMultipleExtensions("c:\\path",".jpg;.jpeg;.jpe;.jfif;.tiff;.tif;.bmp;.dib;.png",";");Savot Danehttp://www.blogger.com/profile/06943811458436051116noreply@blogger.com0