<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Gitolekha's Tech Weblog</title>
	<atom:link href="http://techolyvia.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techolyvia.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 27 Sep 2011 14:03:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='techolyvia.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Gitolekha's Tech Weblog</title>
		<link>http://techolyvia.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://techolyvia.wordpress.com/osd.xml" title="Gitolekha&#039;s Tech Weblog" />
	<atom:link rel='hub' href='http://techolyvia.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Find content databases for web spplication selected in WebApplicationSelector control and all Content DB&#8217;s in the farm</title>
		<link>http://techolyvia.wordpress.com/2011/05/25/find-content-databases-for-web-spplication-selected-in-webapplicationselector-control-and-all-content-dbs-in-the-farm/</link>
		<comments>http://techolyvia.wordpress.com/2011/05/25/find-content-databases-for-web-spplication-selected-in-webapplicationselector-control-and-all-content-dbs-in-the-farm/#comments</comments>
		<pubDate>Wed, 25 May 2011 06:45:48 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/?p=211</guid>
		<description><![CDATA[To find the content databases for the web application selected by WebApplicationSelector control, the code below works: SPWebApplication webApplication = Selector.CurrentItem; SPContentDatabaseCollection contentDBs = webApplication.ContentDatabases; foreach (SPContentDatabase contentDB in contentDBs) { Console.WriteLine(contentDB.Name); } To find all content databases in the Farm, the code is given below: SPServiceCollection services = SPFarm.Local.Services; //foreach (SPService service in services) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=211&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To find the content databases for the web application selected by WebApplicationSelector control, the code below works:</p>
<p>SPWebApplication webApplication = Selector.CurrentItem;<br />
SPContentDatabaseCollection contentDBs = webApplication.ContentDatabases;<br />
foreach (SPContentDatabase contentDB in contentDBs)<br />
{<br />
 Console.WriteLine(contentDB.Name);<br />
}</p>
<p>To find all content databases in the Farm, the code is given below:</p>
<p>SPServiceCollection services = SPFarm.Local.Services;<br />
//foreach (SPService service in services)<br />
{<br />
if (service is SPWebService)<br />
{<br />
SPWebService webService = (SPWebService)service;<br />
SPWebApplicationCollection webApplications = webService.WebApplications;<br />
foreach (SPWebApplication webApplication in webApplications)<br />
{<br />
SPContentDatabaseCollection contentDBs = webApplication.ContentDatabases;<br />
foreach (SPContentDatabase contentDB in contentDBs)<br />
{<br />
Console.WriteLine(contentDB.Name);<br />
}<br />
}<br />
}<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/211/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=211&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2011/05/25/find-content-databases-for-web-spplication-selected-in-webapplicationselector-control-and-all-content-dbs-in-the-farm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
		<item>
		<title>How to get WebID from web services and pass it in GetListItems web service</title>
		<link>http://techolyvia.wordpress.com/2011/05/11/how-to-get-webid-from-web-services-and-pass-it-in-getlistitems-web-service/</link>
		<comments>http://techolyvia.wordpress.com/2011/05/11/how-to-get-webid-from-web-services-and-pass-it-in-getlistitems-web-service/#comments</comments>
		<pubDate>Wed, 11 May 2011 09:03:57 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/?p=209</guid>
		<description><![CDATA[I needed to use GetListItems of web service Lists.asmx, to get all aspx pages in Pages library. However, I saw, that I needed to pass the WebId as parameter to GetListItems. So I added another reference to SiteData.asmx. Below, is the code to get The WebId, need to add reference to Lists.asmx here, webPath is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=209&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I needed to use GetListItems of web service Lists.asmx, to get all aspx pages in Pages library.<br />
However, I saw, that I needed to pass the WebId as parameter to GetListItems. So I added another reference to SiteData.asmx.</p>
<p>Below, is the code to get The WebId, need to add reference to Lists.asmx here, webPath is the url of the sarepoint site.</p>
<p>private Guid GetWebID(string webPath)<br />
{</p>
<p>SiteDataWebService.SiteData siteDataWS = new SiteDataWebService.SiteData();</p>
<p>siteDataWS.UseDefaultCredentials = true;</p>
<p>SiteDataWebService._sWebMetadata webMetaData;</p>
<p>SiteDataWebService._sWebWithTime[] arrWebWithTime;</p>
<p>SiteDataWebService._sListWithTime[] arrListWithTime;</p>
<p>SiteDataWebService._sFPUrl[] arrUrls;</p>
<p>string roles; string[] roleUsers; string[] roleGroups; </p>
<p>siteDataWS.Url = webPath + &#8220;/_vti_bin/sitedata.asmx&#8221;;</p>
<p>siteDataWS.Credentials = new NetworkCredential(username, password, domain);</p>
<p>uint i = siteDataWS.GetWeb(out webMetaData, out arrWebWithTime, out arrListWithTime, out arrUrls, out roles, out roleUsers, out roleGroups);</p>
<p>Guid gid = new Guid(webMetaData.WebID);</p>
<p>return gid;<br />
}</p>
<p>The code to access GetListItems is shown below:</p>
<p>private System.Xml.XmlNode GetItems(string webPath)</p>
<p>{</p>
<p>ListsOnLocalhost.Lists listsWS = new Sharepoint_Unit_Tests.ListsOnLocalhost.Lists();</p>
<p>listsWS.Url = webPath + &#8220;/_vti_bin/lists.asmx&#8221;;</p>
<p>listsWS.UseDefaultCredentials = true;</p>
<p>System.Xml.XmlDocument doc = new System.Xml.XmlDocument();</p>
<p>doc.LoadXml(&#8220;&#8221;);</p>
<p>System.Xml.XmlNode listQuery = doc.SelectSingleNode(&#8220;//Query&#8221;);</p>
<p>System.Xml.XmlNode listViewFields = doc.SelectSingleNode(&#8220;//ViewFields&#8221;);</p>
<p>System.Xml.XmlNode listQueryOptions = doc.SelectSingleNode(&#8220;//QueryOptions&#8221;);</p>
<p>Guid gid = GetWebID(webPath);</p>
<p>System.Xml.XmlNode items = listsWS.GetListItems(listName.Text, string.Empty, listQuery, listViewFields, string.Empty, listQueryOptions, gid.ToString());</p>
<p>return items;</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=209&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2011/05/11/how-to-get-webid-from-web-services-and-pass-it-in-getlistitems-web-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting error while creating setup project with prerequisite .NET 3.5 SP1</title>
		<link>http://techolyvia.wordpress.com/2011/05/04/getting-error-while-creating-setup-project-with-prerequisite-net-3-5-sp1/</link>
		<comments>http://techolyvia.wordpress.com/2011/05/04/getting-error-while-creating-setup-project-with-prerequisite-net-3-5-sp1/#comments</comments>
		<pubDate>Wed, 04 May 2011 17:36:12 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/?p=202</guid>
		<description><![CDATA[I had VS2008,when trying to create setup project , while trying to add prerequisite of  3.5 SP1, was getting lot of errors like &#8220;The install location for prerequisites has not been set to &#8216;component vendor&#8217;s web site&#8217; and the file &#8216;DotNetFX35SP1\dotNetFX20\aspnet.msp&#8217; in item &#8216;.NET Framework 3.5 SP1&#8242; can not be located on disk. &#8220; The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=202&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had VS2008,when trying to create setup project , while trying to add prerequisite of  3.5 SP1, was getting lot of errors like &#8220;The install location for prerequisites has not been set to &#8216;component vendor&#8217;s web site&#8217; and the file &#8216;DotNetFX35SP1\dotNetFX20\aspnet.msp&#8217; in item &#8216;.NET Framework 3.5 SP1&#8242; can not be located on disk. &#8220;</p>
<p>The solution of this can be found at <a href="http://download.microsoft.com/download/A/2/8/A2807F78-C861-4B66-9B31-9205C3F22252/VS2008SP1Readme.htm">http://download.microsoft.com/download/A/2/8/A2807F78-C861-4B66-9B31-9205C3F22252/VS2008SP1Readme.htm</a></p>
<p>When I performed the steps shown in the above link,my problem was solved. Stating the steps mentioned in the link once more here,</p>
<p>If the .NET Framework 3.5 SP1 bootstrapper package is selected in the Prerequisite dialog box for a Setup project or in ClickOnce publishing, and also the &#8220;Download prerequisites from the same location as my application&#8221; option is selected, the following build error is shown: </p>
<p>The install location for prerequisites has not been set to &#8216;component vendor&#8217;s web site&#8217; and the file &#8216;dotNetFx35setup.exe&#8217; in item &#8216;Microsoft.Net.Framework.3.5.SP1&#8242; cannot be located on disk.</p>
<p><span style="text-decoration:underline;">To resolve this issue:</span></p>
<p>Update the Package Data</p>
<ol>
<li>Open the [Program Files]\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder or %ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 on x64 operating systems</li>
<li>Edit the Product.xml file in Notepad.</li>
<li>Paste the following into the &lt; PackageFiles &gt; element:<br />
&lt;PackageFile Name=&#8221;TOOLS\clwireg.exe&#8221;/&gt;<br />
&lt;PackageFile Name=&#8221;TOOLS\clwireg_x64.exe&#8221;/&gt;<br />
&lt;PackageFile Name=&#8221;TOOLS\clwireg_ia64.exe&#8221;/&gt;</li>
<li>Find the element for &lt; PackageFile Name=&#8221;dotNetFX30\XPSEPSC-x86-en-US.exe&#8221; and change the PublicKey value to: 3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001</li>
<li>Find the element for &lt; PackageFile Name=&#8221;dotNetFX30\XPSEPSC-amd64-en-US.exe&#8221; and change the PublicKey value to the same as in step 4 above</li>
<li>Save the product.xml file</li>
</ol>
<p> </p>
<p>Download and Extract the Core Installation Files</p>
<ol>
<li>Navigate to the following URL: http://go.microsoft.com/fwlink?LinkID=118080</li>
<li>Download the dotNetFx35.exe file to your local disk.</li>
<li>Open a Command Prompt window and change to the directory to which you downloaded dotNetFx35.exe.</li>
<li>At the command prompt, type:<br />
dotNetFx35.exe /x:.<br />
This will extract the Framework files to a folder named “WCU” in the current directory.</li>
<li>Copy the contents of the WCU\dotNetFramework folder and paste them in the %Program Files%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder (%ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 on x64 operating systems). Note: Do not copy the WCU\dotNetFramework folder itself. There should be 5 folders under the WCU folder, and each of these should now appear in the DotNetFx35SP1 folder. The folder structure should resemble the following:<br />
o DotNetFx35SP1 (folder)</p>
<ul>
<li>dotNetFX20 (folder</li>
<li>dotNetFX30 (folder)</li>
<li>dotNetFX35 (folder)</li>
<li>dotNetMSP (folder)</li>
<li>TOOLS folder)</li>
<li>en (or some other localized folder)</li>
<li>dotNetFx35setup.exe (file)</li>
</ul>
</li>
</ol>
<p>You may now delete the files and folders you downloaded and extracted in steps 2 and 4.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=202&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2011/05/04/getting-error-while-creating-setup-project-with-prerequisite-net-3-5-sp1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
		<item>
		<title>Read selected value from dropdownlist, and set the maxlength of a textbox through javascript in user control.</title>
		<link>http://techolyvia.wordpress.com/2011/03/09/read-selected-value-from-dropdownlist-and-set-the-maxlength-of-a-textbox-through-javascript-in-user-control/</link>
		<comments>http://techolyvia.wordpress.com/2011/03/09/read-selected-value-from-dropdownlist-and-set-the-maxlength-of-a-textbox-through-javascript-in-user-control/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 11:43:41 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[read selected value from dropdownlist using javascript]]></category>
		<category><![CDATA[set maxLength of textbox using javascript]]></category>
		<category><![CDATA[using javascript inside usercontrol using ClientID]]></category>
		<category><![CDATA[using onchange event of dropdownlist using javascript]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/?p=188</guid>
		<description><![CDATA[I would like to read selected value from dropdownlist and accordingly, set the maxlength of a textbox through javascript. To use javascript inside a user control, one should remember, while it is rendered in the page, a control called txtComany will be having a name like ctl03$txtComany when it is rendered on the page. Hence [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=188&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I would like to read selected value from dropdownlist and accordingly, set the maxlength of a textbox through javascript.</p>
<p>To use javascript inside a user control, one should remember, while it is rendered in the page, a control called txtComany will be having a name like ctl03$txtComany when it is rendered on the page.</p>
<p>Hence it is important to call the clientId of the textbox like :</p>
<p>document.getElementById(<span style="color:#993366;">&#8220;&lt;%=txtComany.ClientID%&gt;&#8221;</span>).value;</p>
<p><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p>function SetTextBoxMaxLength() {<br />
var e = document.getElementById(<span style="color:#993366;">&#8220;&lt;%=DropDownlist1.ClientID%&gt;<!--ropdownList1.ClientI-->&#8220;</span>);<br />
var strUser = e.options[e.selectedIndex].text;<br />
if (strUser == <span style="color:#993366;">&#8220;Cargo &#8221; </span>|| strUser == <span style="color:#993366;">&#8220;Agent&#8221;</span>) {<br />
<span style="color:#008000;">//Set maxlength of textbox to 11 through Javascript</span><br />
document.getElementById(<span style="color:#993366;">&#8220;&lt;%=TextBox1.ClientID%&gt;<!--ropdownList1.ClientI-->&#8220;</span>).maxLength = 11<br />
}<br />
else {<br />
<span style="color:#008000;">//Set maxlength of textbox to 8 through Javascript</span><br />
document.getElementById(<span style="color:#993366;">&#8220;&lt;%=TextBox1.ClientID%&gt;<!--ropdownList1.ClientI-->&#8220;<span style="color:#000000;">)</span></span>.maxLength = 8<br />
}<br />
}</p>
<p>The HTML of the page is like</p>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&lt;<span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">asp</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">:</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">TextBox</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">CssClass</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;contact&#8221;</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">ID</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;CUECode&#8221;</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">onKeyDown</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;SetCUECodeMaxLength();&#8221;</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">runat</span></span></span></span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;server&#8221;/&gt;</span></span></span></span></span><span style="font-size:x-small;color:#0000ff;"> </span></p>
<p>To get selected value from dropdownlist using javascript:</p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:blue;font-family:&quot;">var </span><span style="font-size:10pt;font-family:&quot;">e = document.getElementById(<span style="color:#a31515;">&#8220;&lt;%=Dropdown1.ClientID%&gt;&#8221;</span>);</span></p>
<p><span style="font-size:10pt;color:blue;font-family:&quot;">var</span><span style="font-size:10pt;font-family:&quot;"> strUser = e.options[e.selectedIndex].text;</span></p>
<p><span style="font-size:10pt;font-family:&quot;"> To use<strong> onchange </strong>event of dropdownlist instead of using the selectedindexchange event through code behind to prevent postback, suppose the HTML is as shown below:</span></p>
<div><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&lt;<span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">asp</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">:</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">DropDownList</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">ID</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;DropDown1&#8243;</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">runat</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;server&#8221;</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">onchange</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;ClearTextBox();&#8221;</span></span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;">class</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;type&#8221;/&gt;</span></span></span></span></span></div>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"></p>
<div><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="color:#0000ff;font-size:x-small;">function <span style="font-size:x-small;">ClearTextBox() {</span></span></span></span></span></span></span></div>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="color:#0000ff;font-size:x-small;"> <span style="font-size:x-small;"> </span></p>
<div><span style="font-size:x-small;"><span style="font-size:x-small;"> <span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">if</span></span><span style="font-size:x-small;"> (document.getElementById(</span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">&#8220;&lt;%=TextBox1.ClientID%&gt;&#8221;</span></span><span style="font-size:x-small;">).value.length &gt; 0) {</span></span></span></div>
<p></span></span></span></span></span></span><span style="font-size:x-small;"><span style="font-size:x-small;"> </p>
<p></span></p>
<div><span style="font-size:x-small;"><span style="font-size:x-small;">document.getElementById(<span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">&#8220;&lt;%=TextBox1.ClientID%&gt;&#8221;</span></span><span style="font-size:x-small;">).value = </span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">&#8220;&#8221;</span></span><span style="font-size:x-small;">;</span></span></span></div>
<p><span style="font-size:x-small;"><span style="font-size:x-small;"></p>
<div><span style="font-size:x-small;">}</span></div>
<p></span></span><span style="font-size:x-small;">}</p>
<div><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="color:#0000ff;font-size:x-small;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"> </span></span></span></span></span></span></span></span></span></span></div>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;"><span style="color:#0000ff;font-size:x-small;"> </p>
<p></span></span></span></span></span></span></span> </p>
<p></span></span></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/188/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=188&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2011/03/09/read-selected-value-from-dropdownlist-and-set-the-maxlength-of-a-textbox-through-javascript-in-user-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
		<item>
		<title>Write data from Sharepoint list to Excel</title>
		<link>http://techolyvia.wordpress.com/2011/02/11/write-data-from-sharepoint-list-to-excel/</link>
		<comments>http://techolyvia.wordpress.com/2011/02/11/write-data-from-sharepoint-list-to-excel/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 13:46:27 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sharepoint listitem to excel]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/?p=183</guid>
		<description><![CDATA[The export to spreadsheet link was not visible in a particular list and we had an urgent request to export data from list to an excel. So we created a windows application to take care of it. Added web reference http://extranet/sites/sis-forum/_vti_bin/lists.asmx to the project and named it Sisforum. Added a textbox txtSiteUrl  in the Windows form&#8230;and added the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=183&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The export to spreadsheet link was not visible in a particular list and we had an urgent request to export data from list to an excel.</p>
<p>So we created a windows application to take care of it.</p>
<p>Added web reference <a href="http://extranet/sites/sis-forum/_vti_bin/lists.asmx">http://extranet/sites/sis-forum/_vti_bin/lists.asmx</a> to the project and named it Sisforum.</p>
<p>Added a textbox <span style="font-size:x-small;"><strong>txtSiteUrl</strong> </span> in the Windows form&#8230;and added the url of the site from where we wanted to export a list to excel e.g <a href="https://corp-extranet.iata.org/sites/isago">https://test-web.domain.org/sites/isago/_vti_bin/lists.asmx</a> , in another textbox <strong><span style="font-size:x-small;">txtListName </span></strong>,gave the name of the list we wanted to export,say &#8220;UserManagement Task&#8221; and a textbox <span style="font-size:x-small;"><strong>txtFilepath</strong> </span> for putting the filepath like &#8220;c:\test.xls&#8221;.</p>
<p><span style="font-size:x-small;"> </span></p>
<p>            StringBuilder strExcel = new StringBuilder();<br />
            StringBuilder strHtml = new StringBuilder();<br />
            System.Net.NetworkCredential credential = new System.Net.NetworkCredential(&#8220;username&#8221;, &#8220;password&#8221;);<br />
            XmlDocument xdoc = new XmlDocument();<br />
            XmlNode allFields = xdoc.CreateElement(&#8220;ViewFields&#8221;);<br />
            XmlNode QueryOpt = xdoc.CreateElement(&#8220;QueryOptions&#8221;);<br />
            XmlNode Query = xdoc.CreateElement(&#8220;Query&#8221;);<br />
            XmlNode xmlResults;<br />
            try<br />
            {<br />
               SisForum.Lists lsts = new ExporttoExcelFile.SisForum.Lists();<br />
                lsts.Credentials = credential;<br />
                lsts.Url = txtSiteUrl.Text+&#8221;/_vti_bin/lists.asmx&#8221;;<br />
                xmlResults = lsts.GetListItems(txtListName.Text, null, null, null, &#8220;1000000&#8243;, null, null);<br />
                <span style="color:#339966;">//Get Header Row</span><br />
                foreach (XmlNode node in xmlResults)<br />
                {<br />
                    if (node.Name == &#8220;rs:data&#8221;)<br />
                    {<br />
                        for (int i = 0; i &lt; 2; i++)<br />
                        {<br />
                            strExcel.Append(&#8220;\n&#8221;);<br />
                           strHtml.Append(&#8220;&#8221;);<br />
                           if (node.ChildNodes[i].Name == &#8220;z:row&#8221;)<br />
                            {<br />
              for (int j = 0; j &lt; node.ChildNodes[i].Attributes.Count; j++)<br />
                                {<br />
                                    if (node.ChildNodes[i].Attributes[j] != null)<br />
                                    {<br />
                     string name = node.ChildNodes[i].Attributes[j].Name;<br />
                                        name = StripHTML(name);<br />
                   strExcel.Append(name.Substring(name.IndexOf(&#8216;#&#8217;) + 1));<br />
                                        strExcel.Append(&#8220;\t&#8221;);<br />
                                    }<br />
                                }<br />
                            }<br />
                        }<br />
                    }<br />
                }</p>
<p>                <span style="color:#008000;">//Get List Items</span><br />
                foreach (XmlNode node in xmlResults)<br />
                {<br />
                    if (node.Name == &#8220;rs:data&#8221;)<br />
                    {<br />
                        for (int i = 0; i &lt; node.ChildNodes.Count; i++)<br />
                        {<br />
                            strExcel.Append(&#8220;\n&#8221;);<br />
                            strHtml.Append(&#8220;&#8221;);<br />
                            if (node.ChildNodes[i].Name == &#8220;z:row&#8221;)<br />
                            {  <br />
                                <span style="color:#008000;">//get list items</span><br />
          for (int j = 0; j &lt; node.ChildNodes[i].Attributes.Count; j++)<br />
                                {<br />
                                    if (node.ChildNodes[i].Attributes[j] != null)<br />
                                    {<br />
        string name = node.ChildNodes[i].Attributes[j].Value;<br />
                                        name = StripHTML(name);<br />
                   strExcel.Append(name.Substring(name.IndexOf(&#8216;#&#8217;) + 1));<br />
                                        strExcel.Append(&#8220;\t&#8221;);<br />
                                    }<br />
                                }<br />
                            }<br />
                        }<br />
                    }<br />
                }<br />
               WritetoFile(strExcel,&#8221;xls&#8221;);<br />
               MessageBox.Show(&#8220;Completted&#8221;);<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
                MessageBox.Show(ex.Message);<br />
            }<br />
        }</p>
<p>public void WritetoFile(StringBuilder str,string Format)</p>
<p>        {</p>
<p>            string filename = txtFilepath.Text;</p>
<p>            TextWriter tw = new StreamWriter(filename);</p>
<p>            tw.Write(str);</p>
<p>            tw.Close();</p>
<p>        }</p>
<p>Now the string that we get from the xml by calling GetListItems needs to be formatted.We need to remove HTML development formatting, replace line breaks with space because browsers insert spaces,remove all scripts etc. The below functio takes care of that:</p>
<p>public string StripHTML(string source)</p>
<p>        {</p>
<p>            try</p>
<p>            {</p>
<p>                string result;</p>
<p>                <span style="color:#008000;">// Remove HTML Development formatting</span></p>
<p><span style="color:#008000;">                // Replace line breaks with space</span></p>
<p><span style="color:#008000;">                // because browsers inserts space</span></p>
<p>                result = source.Replace(&#8220;\r&#8221;, &#8221; &#8220;);</p>
<p>                <span style="color:#008000;">// Replace line breaks with space</span></p>
<p><span style="color:#008000;">                // because browsers inserts space</span></p>
<p>                result = result.Replace(&#8220;\n&#8221;, &#8221; &#8220;);</p>
<p>                <span style="color:#008000;">// Remove step-formatting</span></p>
<p>                result = result.Replace(&#8220;\t&#8221;, string.Empty);</p>
<p>                <span style="color:#008000;">// Remove repeating spaces because browsers ignore them</span></p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;( )+&#8221;, &#8221; &#8220;);</p>
<p><span style="color:#008000;">// Remove the header (prepare first by clearing attributes)</span></p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result, @&#8221;&lt;( )*head([^&gt;])*&gt;&#8221;, &#8220;&lt;head&gt;&#8221;,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>                result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;(&lt;( )*(/)( )*head( )*&gt;)&#8221;, &#8220;&lt;/head&gt;&#8221;,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>                result = System.Text.RegularExpressions.Regex.Replace(result,  &#8220;(&lt;head&gt;).*(&lt;/head&gt;)&#8221;, string.Empty,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p><span style="color:#008000;">// remove all scripts (prepare first by clearing attributes)</span></p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,    @&#8221;&lt;( )*script([^&gt;])*&gt;&#8221;, &#8220;&lt;script&gt;&#8221;,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>                result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;(&lt;( )*(/)( )*script( )*&gt;)&#8221;, &#8220;&lt;/script&gt;&#8221;,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);         </p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,   @&#8221;(&lt;script&gt;).*(&lt;/script&gt;)&#8221;, string.Empty,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p><span style="color:#008000;">// remove all styles (prepare first by clearing attributes)</span></p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,   @&#8221;&lt;( )*style([^&gt;])*&gt;&#8221;, &#8220;&lt;style&gt;&#8221;,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,    @&#8221;(&lt;( )*(/)( )*style( )*&gt;)&#8221;, &#8220;&lt;/style&gt;&#8221;,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result, &#8221;(&lt;style&gt;).*(&lt;/style&gt;)&#8221;, string.Empty,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>                <span style="color:#008000;">// insert tabs in spaces of &lt;td&gt; tags</span></p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;&lt;( )*td([^&gt;])*&gt;&#8221;, &#8220;\t&#8221;,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>                <span style="color:#008000;">// insert line breaks in places of &lt;BR&gt; and &lt;LI&gt; tags</span></p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,    @&#8221;&lt;( )*br( )*&gt;&#8221;, &#8220;\r&#8221;,                          System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,   @&#8221;&lt;( )*li( )*&gt;&#8221;, &#8220;\r&#8221;,  System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>                <span style="color:#008000;">// insert line paragraphs (double line breaks) in place</span></p>
<p>                <span style="color:#008000;">// if &lt;P&gt;, &lt;DIV&gt; and &lt;TR&gt; tags</span></p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;&lt;( )*div([^&gt;])*&gt;&#8221;, string.Empty,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;&lt;( )*tr([^&gt;])*&gt;&#8221;, string.Empty,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,   @&#8221;&lt;( )*p([^&gt;])*&gt;&#8221;, string.Empty,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>                <span style="color:#008000;">// Remove remaining tags like &lt;a&gt;, links, images,</span></p>
<p><span style="color:#008000;">                // comments etc &#8211; anything that&#8217;s enclosed inside &lt; &gt;</span></p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result, @&#8221;&lt;[^&gt;]*&gt;&#8221;, string.Empty,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>               <span style="color:#008000;"> // replace special characters:</span></p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,   @&#8221; &#8220;, &#8221; &#8220;,   System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result, @&#8221;&amp;bull;&#8221;, &#8221; * &#8220;,   System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,   @&#8221;&amp;lsaquo;&#8221;, &#8220;&lt;&#8221;,  System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;&amp;rsaquo;&#8221;, &#8220;&gt;&#8221;,     System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;&amp;trade;&#8221;, &#8220;(tm)&#8221;,   System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result, @&#8221;&amp;frasl;&#8221;, &#8220;/&#8221;,   System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result, @&#8221;&amp;lt;&#8221;, &#8220;&lt;&#8221;,    System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result, @&#8221;&amp;gt;&#8221;, &#8220;&gt;&#8221;,  System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,   @&#8221;&amp;copy;&#8221;, &#8220;(c)&#8221;,    System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;&amp;reg;&#8221;, &#8220;(r)&#8221;,   System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>result = System.Text.RegularExpressions.Regex.Replace(result,  @&#8221;&amp;(.{2,6});&#8221;, string.Empty,                         System.Text.RegularExpressions.RegexOptions.IgnoreCase);</p>
<p>                return result;</p>
<p>            }</p>
<p>            catch</p>
<p>            {</p>
<p>                return source;</p>
<p>            }</p>
<p>        }</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/183/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=183&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2011/02/11/write-data-from-sharepoint-list-to-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert excel sheet to dataset</title>
		<link>http://techolyvia.wordpress.com/2011/02/04/convert-excel-sheet-to-dataset/</link>
		<comments>http://techolyvia.wordpress.com/2011/02/04/convert-excel-sheet-to-dataset/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 13:30:35 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA['Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine]]></category>
		<category><![CDATA[Encoding xml]]></category>
		<category><![CDATA[excel sheet to dataset]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/?p=176</guid>
		<description><![CDATA[ I had to convert an excel file with different languages into a xml/dataset. Below is the sample excel sheet I had English French Spanish Portugese Guinea Guinéee Guinea Guiné Côte d&#8217;Ívoire Côte d&#8217;Ívoire Costa de Marfil Costa do Marfim South Africa Afrique du Sud Sudáfrica África do Sul For Excel 97-2003 format Microsoft Jet OLEDB [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=176&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> I had to convert an excel file with different languages into a xml/dataset.</p>
<p>Below is the sample excel sheet I had</p>
<table border="0" cellspacing="0" cellpadding="0" width="256">
<tbody>
<tr>
<td width="64" valign="bottom"><strong>English</strong></td>
<td width="64" valign="bottom"><strong>French</strong></td>
<td width="64" valign="top"><strong>Spanish</strong></td>
<td width="64" valign="top"><strong>Portugese</strong></td>
</tr>
<tr>
<td width="64" valign="bottom"><span style="color:#800000;">Guinea</span></td>
<td width="64" valign="bottom"><span style="color:#800000;">Guinéee</span></td>
<td width="64" valign="top"><span style="color:#800000;">Guinea</span></td>
<td width="64" valign="top"><span style="color:#800000;">Guiné</span></td>
</tr>
<tr>
<td width="64" valign="bottom"><span style="color:#800000;">Côte d&#8217;Ívoire</span></td>
<td width="64" valign="bottom"><span style="color:#800000;">Côte d&#8217;Ívoire</span></td>
<td width="64" valign="top"><span style="color:#800000;">Costa de Marfil</span></td>
<td width="64" valign="top"><span style="color:#800000;">Costa do Marfim</span></td>
</tr>
<tr>
<td width="64" valign="bottom"><span style="color:#800000;">South Africa</span></td>
<td width="64" valign="bottom"><span style="color:#800000;">Afrique du Sud</span></td>
<td width="64" valign="top"><span style="color:#800000;">Sudáfrica</span></td>
<td width="64" valign="top"><span style="color:#800000;">África do Sul</span></td>
</tr>
</tbody>
</table>
<p style="text-align:justify;"><span style="color:#000000;">For Excel 97-2003 format <strong>Microsoft Jet OLEDB Driver 4.0</strong> is used. A sample connection string as follows.For Excel 2007 format the new <strong>Microsoft Ace OLEDB Driver 4.0</strong> is used.</span></p>
<p><span style="color:#000000;">Code to convert is shown below:</span></p>
<p style="text-align:justify;"><span style="color:#339966;"><span style="color:#000000;">//</span><strong>Connection String for Excel 97-2003 Format (.XLS)</strong></span></p>
<p style="text-align:justify;"><span style="color:#3366ff;">String </span>strExcelConn = &#8220;<span style="color:#993366;">Provider=Microsoft.Jet.OLEDB.4.0;&#8221;</span></p>
<p><span style="color:#993366;"><span style="color:#000000;">+</span> &#8220;Data Source=C:\\Gitolekha\\test.xls;</span>&#8220;</p>
<p>+ <span style="color:#993366;">&#8220;Extended Properties=&#8217;Excel 8.0;HDR=Yes&#8217;</span>&#8220;;</p>
<p><span style="color:#008000;">//Connect to excel sheet</span></p>
<p><span style="color:#3366ff;">OleDbConnection</span> connExcel = <span style="color:#333399;">new </span><span style="color:#3366ff;">OleDbConnection</span>(strExcelConn);</p>
<p><span style="color:#3366ff;">OleDbDataAdapter</span> da = <span style="color:#333399;">new </span><span style="color:#3366ff;">OleDbDataAdapter</span>();</p>
<p><span style="color:#3366ff;">OleDbCommand</span> cmdExcel = <span style="color:#333399;">new</span> <span style="color:#3366ff;">OleDbCommand</span>();</p>
<p>cmdExcel.Connection = connExcel;</p>
<p><span style="color:#008080;">//Access the sheet</span></p>
<p>connExcel.Open();</p>
<p><span style="color:#3366ff;">DataTable </span>dtExcelSchema;</p>
<p>dtExcelSchema = connExcel.GetOleDbSchemaTable(<span style="color:#3366ff;">OleDbSchemaGuid</span>.Tables, <span style="color:#333399;">null</span>);</p>
<p><span style="color:#3366ff;">DataSet </span>ds = <span style="color:#333399;">new</span> <span style="color:#3366ff;">DataSet</span>();</p>
<p>string SheetName = dtExcelSchema.Rows[0]["<span style="color:#800080;">TABLE_NAME</span>"].ToString();<span style="color:#008000;">//It fetches the first sheet Sheet1$</span></p>
<p>cmdExcel.CommandText = &#8220;<span style="color:#800080;">SELECT * From </span>[" + SheetName + "]&#8220;;</p>
<p>da.SelectCommand = cmdExcel;</p>
<p>da.Fill(ds);</p>
<p>connExcel.Close();</p>
<p> <span style="color:#3366ff;">StringWriter </span>sw = <span style="color:#000080;">new </span><span style="color:#3366ff;">StringWriter</span>();</p>
<p>ds.WriteXml(sw, <span style="color:#3366ff;">XmlWriteMode</span>.IgnoreSchema);</p>
<p><span style="color:#333399;"> string</span> textToConvert = sw.ToString();</p>
<p><span style="color:#339966;">//Encoding xml as it contains non ASCII characters of different languages</span> </p>
<p><span style="color:#3366ff;">Encoding </span>latin = <span style="color:#3366ff;">Encoding</span>.GetEncoding(28591);</p>
<p><span style="color:#3366ff;">Encoding </span>iso8= <span style="color:#3366ff;">Encoding</span>.GetEncoding(&#8220;<span style="color:#800080;">iso-8859-8</span>&#8220;);</p>
<p><span style="color:#3366ff;">Byte</span>[] latinBytes= latin.GetBytes(textToConvert);</p>
<p><span style="color:#3366ff;">Byte</span>[] iso8bytes = <span style="color:#3366ff;">Encoding</span>.Convert(latin, iso8, latinBytes);</p>
<p><span style="color:#333399;">string</span> str = <span style="color:#3366ff;">Encoding</span>.UTF8.GetString(iso8bytes);</p>
<p><span style="color:#0000ff;">return</span> <span style="color:#333399;">str</span>;</p>
<p>There is one point to remember if you are running this on a 64-bit platform:</p>
<p>I kept on getting eror &#8220;&#8216;<strong>Microsoft.Jet.OLEDB.4.0&#8242; provider is not registered on the local machine</strong>&#8220;, after much searching on the net, I dicovered :</p>
<ul>
<li>there is no Jet OLEDB provider to use on a 64bit platform</li>
</ul>
<p>However, we can configure the IIS to run 32-bit application on 64-bit Windows(IIS 6.0), for details, one can reffer the below url&#8217;s</p>
<p><a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx?mfr=true">http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx?mfr=true</a></p>
<p><a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/13f991a5-45eb-496c-8618-2179c3753bb0.mspx?mfr=true">http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/13f991a5-45eb-496c-8618-2179c3753bb0.mspx?mfr=true</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=176&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2011/02/04/convert-excel-sheet-to-dataset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding links in site settings from site collection</title>
		<link>http://techolyvia.wordpress.com/2010/09/30/adding-links-in-site-settings-from-site-collection/</link>
		<comments>http://techolyvia.wordpress.com/2010/09/30/adding-links-in-site-settings-from-site-collection/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 06:33:22 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/?p=172</guid>
		<description><![CDATA[This example shows how to add custom links under site administrator from site settings page. Below is Elements.xml modification - &#60;Elements xmlns=&#8221;http://schemas.microsoft.com/sharepoint/&#8220;&#62;   &#60;CustomActionGroup Id=&#8221;DF784448-CD3F-4221-9B8A-69769FA961EE&#8221; Title=&#8221;Cargolink Adminsitration&#8221; Location=&#8221;Microsoft.SharePoint.SiteSettings&#8221; Sequence=&#8221;110&#8221; /&#62; - &#60;CustomAction Id=&#8221;EDBEB420-A817-4896-BE42-F5B9048C0CF5&#8221; Title=&#8221;Manage Company Profile&#8221; Location=&#8221;Microsoft.SharePoint.SiteSettings&#8221; GroupId=&#8221;DF784448-CD3F-4221-9B8A-69769FA961EE&#8221; Sequence=&#8221;120&#8221; RequireSiteAdministrator=&#8221;True&#8220;&#62;   &#60;UrlAction Url=&#8221;_layouts/CargoLink/CompanyProfile.aspx&#8221; /&#62;   &#60;/CustomAction&#62; - &#60;CustomAction Id=&#8221;29020219-0C09-4ef0-BF0A-8921F99AD1B0&#8221; Title=&#8221;Import from CSV&#8221; Location=&#8221;Microsoft.SharePoint.SiteSettings&#8221; GroupId=&#8221;DF784448-CD3F-4221-9B8A-69769FA961EE&#8221; Sequence=&#8221;130&#8221; RequireSiteAdministrator=&#8221;True&#8220;&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=172&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This example shows how to add custom links under site administrator from site settings page. Below is Elements.xml modification</p>
<div><a href="/Documents%20and%20Settings/rayg/Local%20Settings/Temp/elements.xml#">-</a> &lt;Elements xmlns=&#8221;<strong>http://schemas.microsoft.com/sharepoint/</strong>&#8220;&gt;</div>
<div>
<div>
<div>  &lt;CustomActionGroup Id=&#8221;<strong>DF784448-CD3F-4221-9B8A-69769FA961EE</strong>&#8221; Title=&#8221;<strong>Cargolink Adminsitration</strong>&#8221; Location=&#8221;<strong>Microsoft.SharePoint.SiteSettings</strong>&#8221; Sequence=&#8221;<strong>110</strong>&#8221; /&gt;</div>
</div>
<div>
<div><a href="/Documents%20and%20Settings/rayg/Local%20Settings/Temp/elements.xml#">-</a> &lt;CustomAction Id=&#8221;<strong>EDBEB420-A817-4896-BE42-F5B9048C0CF5</strong>&#8221; Title=&#8221;<strong>Manage Company Profile</strong>&#8221; Location=&#8221;<strong>Microsoft.SharePoint.SiteSettings</strong>&#8221; GroupId=&#8221;<strong>DF784448-CD3F-4221-9B8A-69769FA961EE</strong>&#8221; Sequence=&#8221;<strong>120</strong>&#8221; RequireSiteAdministrator=&#8221;<strong>True</strong>&#8220;&gt;</div>
<div>
<div>
<div>  &lt;UrlAction Url=&#8221;<strong>_layouts/CargoLink/CompanyProfile.aspx</strong>&#8221; /&gt;</div>
</div>
<div>  &lt;/CustomAction&gt;</div>
</div>
</div>
<div>
<div><a href="/Documents%20and%20Settings/rayg/Local%20Settings/Temp/elements.xml#">-</a> &lt;CustomAction Id=&#8221;<strong>29020219-0C09-4ef0-BF0A-8921F99AD1B0</strong>&#8221; Title=&#8221;<strong>Import from CSV</strong>&#8221; Location=&#8221;<strong>Microsoft.SharePoint.SiteSettings</strong>&#8221; GroupId=&#8221;<strong>DF784448-CD3F-4221-9B8A-69769FA961EE</strong>&#8221; Sequence=&#8221;<strong>130</strong>&#8221; RequireSiteAdministrator=&#8221;<strong>True</strong>&#8220;&gt;</div>
<div>
<div>
<div>  &lt;UrlAction Url=&#8221;<strong>_layouts/CargoLink/CompanyImport.aspx</strong>&#8221; /&gt;</div>
</div>
<div>  &lt;/CustomAction&gt;</div>
<p>   &lt;/Elements&gt;</p>
<p>This will create a new custom group called &#8220;Cargolink Administration&#8221; under the site settings page and have the 2 links placed under it.</p>
<p>There is a property which says RequireSiteAdminsitrator and its made as true. So in that case if non-adminsitrators will not be able to load the page. You can test the permissions too.</p>
<p>If you want to place the links under Site Administration group in Site settings page,this is what you write.</p>
<div>
<div><a href="/Documents%20and%20Settings/rayg/Local%20Settings/Temp/elements.xml#">-</a> &lt;Elements xmlns=&#8221;<strong>http://schemas.microsoft.com/sharepoint/</strong>&#8220;&gt;</div>
<div>
<div>
<div><a href="/Documents%20and%20Settings/rayg/Local%20Settings/Temp/elements.xml#">-</a> &lt;CustomAction Id=&#8221;<strong>EDBEB420-A817-4896-BE42-F5B9048C0CF5</strong>&#8221; Title=&#8221;<strong>Manage Company Profile</strong>&#8221; Location=&#8221;<strong>Microsoft.SharePoint.SiteSettings</strong>&#8221; GroupId=&#8221;<strong>SiteAdministration</strong>&#8221; Sequence=&#8221;<strong>120</strong>&#8221; RequireSiteAdministrator=&#8221;<strong>True</strong>&#8220;&gt;</div>
<div>
<div>
<div>  &lt;UrlAction Url=&#8221;<strong>_layouts/CargoLink/CompanyProfile.aspx</strong>&#8221; /&gt;</div>
</div>
<div>  &lt;/CustomAction&gt;</div>
</div>
</div>
<div>
<div><a href="/Documents%20and%20Settings/rayg/Local%20Settings/Temp/elements.xml#">-</a> &lt;CustomAction Id=&#8221;<strong>29020219-0C09-4ef0-BF0A-8921F99AD1B0</strong>&#8221; Title=&#8221;<strong>Import from CSV</strong>&#8221; Location=&#8221;<strong>Microsoft.SharePoint.SiteSettings</strong>&#8221; GroupId=&#8221;<strong>SiteAdministration</strong>&#8221; Sequence=&#8221;<strong>130</strong>&#8221; RequireSiteAdministrator=&#8221;<strong>True</strong>&#8220;&gt;</div>
<div>
<div>
<div>  &lt;UrlAction Url=&#8221;<strong>_layouts/CargoLink/CompanyImport.aspx</strong>&#8221; /&gt;</div>
</div>
<div>  &lt;/CustomAction&gt;</div>
</div>
</div>
<div>  &lt;/Elements&gt;</div>
<div> </div>
<div>From <span style="color:#800080;">feature.xml</span> in call this element.xml as</div>
<div>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243; ?&gt;</div>
<div>
<div><a href="/Documents%20and%20Settings/rayg/Local%20Settings/Temp/feature.xml#">-</a> &lt;Feature Id=&#8221;<strong>8f20690b-efb1-46bf-99dd-688aab89ac2e</strong>&#8221; Title=&#8221;<strong>Cargolink Administration</strong>&#8221; Description=&#8221;<strong>Cargolink Administration Pages</strong>&#8221; Version=&#8221;<strong>12.0.0.0</strong>&#8221; Hidden=&#8221;<strong>FALSE</strong>&#8221; Scope=&#8221;<strong>Web</strong>&#8221; DefaultResourceFile=&#8221;<strong>core</strong>&#8221; xmlns=&#8221;<strong>http://schemas.microsoft.com/sharepoint/</strong>&#8220;&gt;</div>
<div>
<div>
<div><a href="/Documents%20and%20Settings/rayg/Local%20Settings/Temp/feature.xml#">-</a> &lt;ElementManifests&gt;</div>
<div>
<div>
<div>  &lt;ElementManifest Location=&#8221;<strong>elements.xml</strong>&#8221; /&gt;</div>
</div>
<div>  &lt;/ElementManifests&gt;</div>
</div>
</div>
<div>  &lt;/Feature&gt;</div>
<div> </div>
<div>Run the stsadm to install the feature.</div>
<div>
<p>Stsadm to install feature</p>
<p> C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN&gt;stsadm -o installfeature -name &#8220;CargolinkAdministration&#8221;  -force</p>
</div>
<div>The go to site site actions -&gt; site settings Site Features and Activate the Feature “Cargolink Adminisrtation” .</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=172&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2010/09/30/adding-links-in-site-settings-from-site-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
		<item>
		<title>Export List Template not retaining look up column values</title>
		<link>http://techolyvia.wordpress.com/2010/07/29/export-list-template-not-retaining-look-up-column-values/</link>
		<comments>http://techolyvia.wordpress.com/2010/07/29/export-list-template-not-retaining-look-up-column-values/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 09:18:01 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[List Template not retaining look up column values]]></category>
		<category><![CDATA[List Template problems with look up columns]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/?p=167</guid>
		<description><![CDATA[It is a known issue that on exporting list items,look up column values are lost. If the list is very big,it might not be possible to fix that manually.This problem occues since list template does look up on a table using GUID,on creating a list template and exporting to a different site,this GUID changes,hence it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=167&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is a known issue that on exporting list items,look up column values are lost.</p>
<p>If the list is very big,it might not be possible to fix that manually.This problem occues since list template does look up on a table using GUID,on creating a list template and exporting to a different site,this GUID changes,hence it is no longer able to retain the values.</p>
<p>Suppose I have a list <span style="color:#0000ff;">&#8220;Category&#8221;</span> which has a look up column &#8220;<span style="color:#993366;">sub category</span>&#8221; which refers to list &#8220;<span style="color:#0000ff;">Sub Categories</span>&#8220;. I assume you have already created a look up list &#8220;Sub Categories&#8221; in the destination web.</p>
<ol>
<li>
<div>Browse to the source Web&#8217;s lookup list &#8220;Sub Category&#8221; and choose Modify settings and columns.</div>
</li>
<li>
<div>Copy the source lookup list GUID from the URL.It should be a sequence of numbers and letters similar to:  %7BFFA47BF8%2D849C%2D4F20%2D9C50%2D173D2F5B6725%7D</div>
</li>
<li>
<div>Browse to the destination Web&#8217;s lookup list and choose Modify settings and columns.</div>
</li>
<li>
<div>Copy the destination lookup list GUID from the URL.Similar as point 2.</div>
</li>
<li>
<div>Delete %2D from the string and replace with a dash sign (-). There should be no dash sign (-) at the start and the end. GUID should be in the following format: FA47BF8-849C-4F20-9C50-173D2F5B6725</div>
</li>
<li>
<div>Save the source Web&#8217;s list that contains a lookup column <span style="color:#0000ff;">&#8220;Category&#8221; </span>to the lookup list as a list template called <span style="color:#993366;">category.stp</span>.</div>
</li>
<li>
<div>Export the list template STP from the source list template gallery to the file system.</div>
</li>
<li>
<div>Rename the <span style="color:#800080;">category.stp</span> file to <span style="color:#800080;">category.cab</span> so Windows can open it.</div>
</li>
<li>
<div>Open the file, right click on the manifest.xml file and export it to the file system.</div>
</li>
<li>
<div>Edit the manifest.xml file; find the source Web&#8217;s lookup list GUID and replace it with the destination Web&#8217;s lookup list GUID.</div>
</li>
<li>
<div>Save the manifest.xml file.</div>
</li>
<li>
<div>Open a VS.NET command prompt.</div>
</li>
<li>
<div>Run the makecab command as: <strong><em>makecab manifest.xml category.stp</em></strong></div>
</li>
<li>
<div>Import the new STP into the destination Web&#8217;s list template gallery. You will need to delete it if it has previously been imported.</div>
</li>
<li>
<div>Create a new list <span style="color:#0000ff;">&#8220;Category&#8221;</span> based upon the new STP file.</div>
</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=167&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2010/07/29/export-list-template-not-retaining-look-up-column-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
		<item>
		<title>Trying to use an SPWeb object that has been closed or disposed and is no longer valid.</title>
		<link>http://techolyvia.wordpress.com/2010/04/28/trying-to-use-an-spweb-object-that-has-been-closed-or-disposed-and-is-no-longer-valid/</link>
		<comments>http://techolyvia.wordpress.com/2010/04/28/trying-to-use-an-spweb-object-that-has-been-closed-or-disposed-and-is-no-longer-valid/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 11:24:32 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Trying to use an SPWeb object that has been closed or disposed and is no longer valid]]></category>
		<category><![CDATA[SPSite]]></category>
		<category><![CDATA[SPWeb]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/?p=162</guid>
		<description><![CDATA[I was writing code using SPWeb under the impression that &#8220;using&#8221; statement takes care of disposing objects. My Function was something like the one shown below: public void LoadFunction() { using (SPWeb ospWeb = SPContext.Current.Web) { &#8230;.Logic } } However,I kept getting the error &#8220;Trying to use an SPWeb object that has been closed or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=162&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was writing code using SPWeb under the impression that &#8220;using&#8221; statement takes care of disposing objects.<br />
My Function was something like the one shown below:</p>
<p>public void LoadFunction()<br />
{<br />
using (SPWeb ospWeb = SPContext.Current.Web)<br />
{<br />
&#8230;.Logic<br />
}<br />
}</p>
<p>However,I kept getting the error &#8220;Trying to use an SPWeb object that has been closed or disposed and is no longer valid.&#8221;<br />
I realized, we should dispose off the SPSite object and not the SPWeb object directly.</p>
<p>So,I modified the code as shown below:</p>
<p>public void LoadFunction()<br />
{<br />
using(SPSite spSite=new SPSite(SPContext.Current.Web.Url))<br />
{<br />
using (SPWeb spWeb = spSite.OpenWeb())<br />
{<br />
&#8230;.Logic<br />
}<br />
}<br />
}</p>
<p>This solved the problem of &#8220;Trying to use an SPWeb object that has been closed or disposed and is no longer valid.&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/162/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=162&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2010/04/28/trying-to-use-an-spweb-object-that-has-been-closed-or-disposed-and-is-no-longer-valid/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding Picture Library/Document Library programmatically</title>
		<link>http://techolyvia.wordpress.com/2010/04/23/adding-picture-librarydocument-library-programmatically/</link>
		<comments>http://techolyvia.wordpress.com/2010/04/23/adding-picture-librarydocument-library-programmatically/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 13:14:40 +0000</pubDate>
		<dc:creator>techolyvia</dc:creator>
				<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[add document library programmatically]]></category>
		<category><![CDATA[PictureLibrary]]></category>
		<category><![CDATA[SPListTemplateType]]></category>

		<guid isPermaLink="false">http://techolyvia.wordpress.com/2010/04/23/adding-picture-librarydocument-library-programmatically/</guid>
		<description><![CDATA[We sometimes need to add lists,document/image libraries to a site automatically, or in other words when a feature is activated.To do that,we need a Feature Receiver class and on Feature Activated,we need to write the code for asdding list/doc library/picture library using (SPSite siteCollection = new SPSite(&#8220;Absolute_url&#8221;)) { using (SPWeb mySite = siteCollection.OpenWeb()) { SPListCollection [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=161&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We sometimes need to add lists,document/image libraries to a site automatically, or in other words when a feature is activated.To do that,we need a Feature Receiver class and on Feature Activated,we need to write the code for asdding list/doc library/picture library</p>
<p>using (SPSite siteCollection = new SPSite(&#8220;Absolute_url&#8221;))<br />
{<br />
using (SPWeb mySite = siteCollection.OpenWeb())<br />
{<br />
  SPListCollection _Lists = mySite.Lists;<br />
       try<br />
          {<br />
              if (_Lists[strListName] != null)<br />
                  Message += &#8221; List Already Exists&#8221;;</p>
<p>          }<br />
          catch(Exception ex)<br />
          {<br />
            Guid listGuid = _Lists.Add(&#8220;MapPicLibrary&#8221;, &#8220;Map Picture Library&#8221;, SPListTemplateType.PictureLibrary);<br />
          }<br />
}<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techolyvia.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techolyvia.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techolyvia.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techolyvia.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techolyvia.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techolyvia.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techolyvia.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techolyvia.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techolyvia.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techolyvia.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techolyvia.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techolyvia.wordpress.com/161/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techolyvia.wordpress.com/161/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techolyvia.wordpress.com/161/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techolyvia.wordpress.com&amp;blog=2264071&amp;post=161&amp;subd=techolyvia&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techolyvia.wordpress.com/2010/04/23/adding-picture-librarydocument-library-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1ac0ccfaf4d6cbf2dcb01b07cbd4f3fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techolyvia</media:title>
		</media:content>
	</item>
	</channel>
</rss>
