<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SharePoint Integration</title><link>https://www.infopathdev.com:443/forums/46.aspx</link><description> For questions concerning issues in the integration of SharePoint and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Dispose Sharepoint object SPSite</title><link>https://www.infopathdev.com:443/forums/thread/39911.aspx</link><pubDate>Tue, 24 Mar 2009 14:57:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39911</guid><dc:creator>CraigW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39911.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=39911</wfw:commentRss><description>&lt;p&gt;I thought as much. Unfortunately, you will be unable to write code that accesses the SharePoint API unless you are on a SharePoint server.&lt;/p&gt;
&lt;p&gt;The Url property of the SPSite constructor must refer to a site that is in the Server Farm that the code is running on.&amp;nbsp; It cannot be used to connect to a remote farm.&amp;nbsp; To do that, use web services.&lt;/p&gt;
&lt;p&gt;Craig&lt;/p&gt;</description></item><item><title>Re: Dispose Sharepoint object SPSite</title><link>https://www.infopathdev.com:443/forums/thread/39906.aspx</link><pubDate>Tue, 24 Mar 2009 13:53:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39906</guid><dc:creator>rishibajaj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39906.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=39906</wfw:commentRss><description>&lt;p&gt;No, I am developing on Win XP Machine which does not have sharepoint server.&lt;/p&gt;</description></item><item><title>Re: Dispose Sharepoint object SPSite</title><link>https://www.infopathdev.com:443/forums/thread/39905.aspx</link><pubDate>Tue, 24 Mar 2009 13:32:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39905</guid><dc:creator>CraigW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39905.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=39905</wfw:commentRss><description>&lt;p&gt;Are you developing on&amp;nbsp;a SharePoint server?&lt;/p&gt;</description></item><item><title>Re: Dispose Sharepoint object SPSite</title><link>https://www.infopathdev.com:443/forums/thread/39884.aspx</link><pubDate>Mon, 23 Mar 2009 21:22:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39884</guid><dc:creator>rishibajaj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39884.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=39884</wfw:commentRss><description>&lt;p&gt;How can I get access to &amp;quot;mySPSiteObj&amp;quot; object?&lt;/p&gt;
&lt;p&gt;--------------&lt;/p&gt;
&lt;p&gt;I have written this code and every time I execute this code I am getting this exception. I am running this code on Win XP machine where there is no MOSS installed. I am getting this exception-&lt;/p&gt;
&lt;p&gt;---------------&lt;/p&gt;
&lt;p&gt;{System.TypeInitializationException: The type initializer for &amp;#39;Microsoft.SharePoint.CoreResource&amp;#39; threw an exception. ---&amp;gt; System.IO.FileNotFoundException: Could not load file or assembly &amp;#39;Microsoft.SharePoint.intl, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;#39; or one of its dependencies. The system cannot find the file specified.&lt;br /&gt;File name: &amp;#39;Microsoft.SharePoint.intl, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;#39;&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&amp;amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&amp;amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark&amp;amp; stackMark, Boolean forIntrospection)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp;amp; stackMark, Boolean forIntrospection)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.Assembly.Load(String assemblyString)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.SharePoint.CoreResource..cctor()&lt;/p&gt;
&lt;p&gt;--- End of inner exception stack trace ---&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.SharePoint.CoreResource.GetString(ResourceGroup rg, String name, Object[] values)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.SharePoint.SPResource.GetString(String name, Object[] values)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.SharePoint.SPSite..ctor(String requestUrl)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at EntityManagement03202009.FormCode.CTRL242_4_Clicked(Object sender, ClickedEventArgs e)}&lt;/p&gt;
&lt;p&gt;------------------&lt;/p&gt;
&lt;p&gt;my code is here :-&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;SPSite&lt;/font&gt;&lt;font size="2"&gt; site = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;SPSite&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;http://localhost/&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;))&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;catch&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Exception&lt;/font&gt;&lt;font size="2"&gt; ex)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;finally&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;site.Dispose();&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Dispose Sharepoint object SPSite</title><link>https://www.infopathdev.com:443/forums/thread/39882.aspx</link><pubDate>Mon, 23 Mar 2009 21:14:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39882</guid><dc:creator>CraigW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39882.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=39882</wfw:commentRss><description>&lt;p&gt;Hi rishibajaj,&lt;/p&gt;
&lt;p&gt;Do you mean an SPSite object itself?&amp;nbsp; If so, just call mySPSiteObj.Dispose();&lt;/p&gt;
&lt;p&gt;It is preferred though that you use a using() statement:&lt;/p&gt;
&lt;p&gt;using (SPSite&amp;nbsp;mySPSiteObj = new SPSite(&lt;a href="http://myserver/mysite"&gt;http://myserver/mysite&lt;/a&gt;))&lt;br /&gt;{&lt;br /&gt;// your code here&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;The SPSite object is then disposed for you.&lt;/p&gt;
&lt;p&gt;Craig&lt;/p&gt;</description></item><item><title>Dispose Sharepoint object SPSite</title><link>https://www.infopathdev.com:443/forums/thread/39880.aspx</link><pubDate>Mon, 23 Mar 2009 20:59:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39880</guid><dc:creator>rishibajaj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39880.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=39880</wfw:commentRss><description>&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;How can I dispose sharepoint objects using SPSite through VSTA code using C#?&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>