I’ve working on infopath recently. I had to insert a value via code to a sharepoint list and here in how I did it.
XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();
//Create a Navigator object for the field that you want to set.
XPathNavigator TitleDescription = xnDoc.SelectSingleNode(”/my:Baseline_Change_Request/my:TitleDescription”, this.NamespaceManager);
XPathNavigator XMLFileName = xnDoc.SelectSingleNode(”/my:Baseline_Change_Request/my:CR_File_Name”, this.NamespaceManager);
//Remove the “nil” attribute.
if (TitleDescription.MoveToAttribute(”nil”, “http://www.w3.org/2001/XMLSchema-instance“))
TitleDescription.DeleteSelf();
//Set the value of the TitleDescriptionField field.
TitleDescription.InnerXml.ToString();
XMLFileName.InnerXml.ToString();
string TitleDescriptionSet = TitleDescription.InnerXml.ToString();
string XMLFileNameSet = XMLFileName.InnerXml.ToString();
SPSListWeb.Lists listService = new SPSListWeb.Lists();
DataSet ds = new DataSet();
/*Authenticate the current user by passing their default
credentials to the Web service from the system credential cache.*/
listService.Credentials = System.Net.CredentialCache.DefaultCredentials;
listService.PreAuthenticate = true;
/*Set the Url property of the service for the path to a subsite.*/
listService.Url = “http://xxxxxx/_vti_bin/lists.asmx“;
listService.PreAuthenticate = true;
/*Get Name attribute values (GUIDs) for list and view. */
System.Xml.XmlNode ndListView = listService.GetListAndView(”One Title”, “”);
string strListID = ndListView.ChildNodes[0].Attributes["Name"].Value;
string strViewID = ndListView.ChildNodes[1].Attributes["Name"].Value;
/*Create an XmlDocument object and construct a Batch element and its attributes. Note that an empty ViewName parameter causes the method to use the default view. */
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
System.Xml.XmlElement batchElement = doc.CreateElement(”Batch”);
batchElement.SetAttribute(”OnError”, “Continue”);
batchElement.SetAttribute(”ListVersion”, “1″);
batchElement.SetAttribute(”ViewName”, strViewID);
XmlDocument documentQuery = new XmlDocument();
XmlElement query = documentQuery.CreateElement(”Query”);
System.Xml.XmlElement viewFields = documentQuery.CreateElement(”ViewFields”);
// The CAML query to return what I’m looking for.
query.InnerXml = ” <Where>” +
“<Eq>” +
“<FieldRef Name=\”Title\” />” +
“<Value Type=\”Text\”>” + TitleDescriptionSet + “</Value>” +
“</Eq>” +
“</Where>”;
string ListName = “BCR Title”;
XmlNode ndResult = listService.GetListItems(ListName, null, query, viewFields, “10″, null, null);
XmlTextReader rdr = new XmlTextReader(ndResult.OuterXml, XmlNodeType.Document, null);
ds.ReadXml(rdr);
ArrayList array = new ArrayList();
if (XMLFileNameSet == “CR_New”)
{
XMLFileNameSet = “No file”;
batchElement.InnerXml = “<Method ID=’1′ Cmd=’New’>” +
“<Field Name=’Title’>” + XMLFileNameSet + “</Field>” +
“<Field Name=’Description’>” + TitleDescriptionSet + “</Field></Method>”;
/*Update list items. This example uses the list GUID, which is recommended, but the list display name will also work.*/
listService.UpdateListItems(strListID, batchElement);
}
if (ds.Tables.Count > 1)
{
DataTable dt = ds.Tables[1];
foreach (DataRow dr in dt.Rows)
{
string UpdateID = dr["ows_ID"].ToString();
batchElement.InnerXml = “<Method ID=’1′ Cmd=’Update’>” +
“<Field Name=’ID’>” + UpdateID + “</Field>” +
“<Field Name=’Title’>” + XMLFileNameSet + “</Field>” +
“<Field Name=’Description’>” + TitleDescriptionSet + “</Field></Method>”;
/*Update list items. This example uses the list GUID, which is recommended, but the list display name will also work.*/
listService.UpdateListItems(strListID, batchElement);
}
}
//Clean up.
xnDoc = null;
TitleDescription = null;
Assigning a task to group was not as simple as I though below is the code that I use to accomplished this.
SPGroup group = SPWeb.UserGroups[“testgroup”];
SPFieldUserValue groupvalueGet = new SPFIeldUserValue(group.ParentWeb, group.ID, group.Name);
SPWorkflowTaskProperties taskProperties = new SPWorkflowTaskProperties();
taskProperties.AssignedTo = groupvalueGet.LookupValue;
How to recover a from a site collection when you get the “404” error page.
1.You would either need a backup of the site collection or
2.SQL backup
Here is how to restore using the SQL backup.
1. Create a new database and restore (through SQL Server)
2. At the command prompt, use stsadm command to add the content database to your site
stsadm.exe -o addcontentdb -url <your url> -databasename <content database> -databaseserver <database server name>
3. Run an IISRESET
4. Go to Central Administration and look at the list of content databases for your web application (under Application Management). There should be two (the old one - with zero sites - and the new one just attached). Delete the old database.
I was presented with the following problem in which sites were getting deleted by a SharePoint bug. The following entry is the steps I went through to determine the issue.
So, the first question I ask myself was. How do sites get deleted?
Via the UI but that would be difficult for an administrator to delete over 300 site collections
Via the API would required someone to write code
SPSite oSiteCollection = new SPSite(”http://” + System.Environment.MachineName + “/sites/Site_Collection”);
oSiteCollection.Delete();
oSiteCollection.Dispose();
After extensive research and using tools such as:
ULS Logs
Netmon
ADO.Net Tracing
DbgView
TDIMon
The issue only occurs on a content database there are no errors on the event log. So what now?
The timer job that was running was either deleted using the Central Admin or Stsadm. Multiple jobs were scheduled before the completion of the current running job. So, the deletion of multiple sites was due to the timer job and user.
If there is another move operation scheduled while the current timer job is running, there will be two move operations at the same moment. This will cause data loss or even massive site collection loss.
Today I handed in my resignation at my current employer.
The new job came looking for me. It’s great to know someone appreciates my skills in effect; I’ve been head-hunted. It’s a great feeling.
I got one week left with my current employer before I start my new job as a SharePoint Architect with a project that consist of half a million employees.
My resolution to the close views for lists
If end user closes the web list web part using the X on the right corner the CAML query and some of the properties get modified. Which prevents the view from displaying the data that should be presented?
That does not mean that the view is corrupted nor the web part is close but there is no way to modify the view. There is a hidden property for the SPView class but setting the value to true does not redisplays the view.
Web parts that are close by passing the var contents=1 on the URL has nothing to do with the views that are not displaying. Microsoft mentions installing the SP1 for SharePoint which does nothing in relation to the views. The problem is CAML query gets modified.
In my opinion the views not displaying any data has to do with the migration.
Original CAML query (Broken)
“<View Name=\”{4222E59E-8879-49F7-AB9D-750A261F851C}\” DefaultView=\”TRUE\” Type=\”HTML\” DisplayName=\”All Documents\” Url=\”/sites/AES/Shared Documents/Forms/AllItems.aspx\” Level=\”1\” BaseViewID=\”1\” ContentTypeID=\”0x\” ImageUrl=\”/_layouts/images/dlicon.png\” ><Query><OrderBy><FieldRef Name=\”FileLeafRef\” /></OrderBy></Query><ViewFields><FieldRef Name=\”DocIcon\” /><FieldRef Name=\”LinkFilename\” /><FieldRef Name=\”Modified\” /><FieldRef Name=\”Editor\” /><FieldRef Name=\”LinkCheckedOutTitle\” /></ViewFields><RowLimit Paged=\”TRUE\”>100</RowLimit></View>”
New CAML after creating a new view
“<View Name=\”{8BAFCD7D-B199-445F-8D6C-F9D625E1D08D}\” DefaultView=\”TRUE\” Type=\”HTML\” DisplayName=\”All Documents\” Url=\”/sites/AES/Shared Documents/Forms/AllItems.aspx\” Level=\”1\” BaseViewID=\”1\” ContentTypeID=\”0x\” ImageUrl=\”/_layouts/images/dlicon.png\” ><Query /><ViewFields><FieldRef Name=\”DocIcon\” /><FieldRef Name=\”LinkFilename\” /><FieldRef Name=\”Modified\” /><FieldRef Name=\”Editor\” /><FieldRef Name=\”LinkCheckedOutTitle\” /></ViewFields><RowLimit Paged=\”TRUE\”>100</RowLimit><Aggregations Value=\”Off\” /></View>”
What is the difference in the views.
The original view(broken). The query does not work because of the two “\”
<Query>
<OrderBy>
<FieldRef Name=\”FileLeafRef\” />
</OrderBy>
</Query>
Should be
<Query>
<OrderBy>
<FieldRef Name=”FileLeafRef” />
</OrderBy>
</Query>
Re-Created View – Sample code not for production
SPSite siteUrl2 = new SPSite(textBox1.Text);
SPWeb myWeb = siteUrl2.OpenWeb();
myWeb.AllowUnsafeUpdates = true;
SPList listtoinsert = myWeb.Lists[newValue.Text];
SPView defaultView = listtoinsert.DefaultView;
listtoinsert.Hidden = true;
listtoinsert.OnQuickLaunch = true;
listtoinsert.EnableVersioning = true;
listtoinsert.Update();
listtoinsert.Fields.AddFieldAsXml(”<Field DisplayName=\”NewField\” Type=\”Boolean\” Required=\”FALSE\” Name=\”NewField\” CanToggleHidden=\”TRUE\” Hidden=\”TRUE\”/>”);
// Create new view columns
StringCollection viewFieldCollection = new StringCollection();
// Add field to collection
viewFieldCollection.Add(”DocIcon”);
viewFieldCollection.Add(”Author”);
viewFieldCollection.Add(”LinkFilename”);
viewFieldCollection.Add(”Last_x0020_Modified”);
viewFieldCollection.Add(”Modified_x0020_By”);
viewFieldCollection.Add(”LinkCheckedOutTitle”);
// Create default view query
string defaultQuery = “<OrderBy><FieldRef Name=\”FileLeafRef\” /></OrderBy>”;
// Get default view information and delete
try
{
Guid oldViewId = listtoinsert.DefaultView.ID;
listtoinsert.Views.Delete(oldViewId);
}
catch
{
}
try
{
listtoinsert.Views.Add(”All Items”, viewFieldCollection, defaultQuery, 100, true, true);
listtoinsert.DefaultView.DefaultView = true;
}
catch
{
}
try
{
listtoinsert.Hidden = true;
listtoinsert.OnQuickLaunch = true;
listtoinsert.EnableVersioning = true;
listtoinsert.Update();
} // try
catch (SPException sp) { }
myWeb.Close();
}
SPSite site = new SPSite(http://laptopdev/sites/eddyblanco);
SPWeb web = site.AllWebs[0];
SPUser user = web.AllUsers["laptopdev\\eddy"];
SPGroup grouptoadd = web.Groups["Full Control"];
grouptoadd.AddUser(user);
in web.config set:
<SafeMode MaxControls=”50″ CallStack=”true“/>
<customErrors mode=”Off”>
Profile Import Error: The specified domain either does not exist or could not be contacted. (Excepti
The other day, I had an issue importing User Profiles and Properties from Active Directory. In this case my MOSS server is on a child domain and it could import the child domain’s objects, but it could not import the objects from the parent domain. Checking the log, I saw an error like the following.
spsimport://domain?$$dl$$
The specified domain either does not exist or could not be contacted. (Exception from HRESULT: 0×8007054B)
I knew I had an issue with how the connections to the Active Directory was configured. On the Manage Connections page, I had one entry for the child domain and one for the parent domain as expected. After examining the parent domain’s connection carefully, I noticed that it auto discovered the domain name incorrectly. In this scenario, the NT domain name is actually something like DOMAIN.COM and the Active Directory name for the domain is domain.local. The name MOSS populated via Auto Discovery was just domain. To resolve this, I created a new connection (because you can’t modify the domain of an existing one). In this new connection, I simply added domain.local as my domain name and used default values for everything else. I deleted the original connection and did the import again. After checking the logs, I saw that everything imported correctly.
I’ve seen the question if it is possible to enable Audience Targetting on a SharePoint document library or list trough code, but I’ve never found an answer to it. But this weekend Ryan Ramcharan posted a solution in one of the SharePoint Forums posts. It looks like you can enable Audience Targeting programatically by adding the Target Audiences field as XML, here is a small code snippet:
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["Shared Documents"];
XmlElement fldElement = new XmlDocument().CreateElement(”Field”);
fldElement.SetAttribute(”ID”, “61cbb965-1e04-4273-b658-eedaa662f48d”);
fldElement.SetAttribute(”Type”, “TargetTo”);
fldElement.SetAttribute(”Name”, “TargetTo”);
fldElement.SetAttribute(”DisplayName”, “Target Audiences”);
fldElement.SetAttribute(”Required”, “FALSE”);
list.Fields.AddFieldAsXml(fldElement.OuterXml);
list.Update();
}
}
The strange thing is that this seems to only way to add the field, you can’t get a hold of the Target Audiences field through the Object Model. Thanks Ryan for posting this solution! And if you know a nicer way to accomplish this, feel free to drop a comment.
Thanks to Jan Tielens for the information
MOSS on a 2 server farm
- Create a local admin user on the SharePoint Server
- Create a database user with security admin and db creator roles.
- Now you can install MOSS on the SharePoint Server, but do not go to the configuration wizard!
- After the installation go to the bin directory in the ‘12 hyve’ with a command prompt and do the following things:
- psconfig.exe -cmd configdb -create -server [sqlserver name] -database [configdbnaam] -user [local admin user op webserver] -password “[password]” -admincontentdatabase [admin content db naam] -dbuser [SQL accountname] -dbpassword “[password]“
- psconfig.exe -cmd adminvs -provision -port [port number for central admin] -windowsauthprovider onlyusentlm
- psconfig.exe -cmd helpcollections -installall
- psconfig.exe -cmd installfeatures
- psconfig.exe -cmd secureresources
- psconfig.exe -cmd services -provision ==> error about the search server email address
- iisreset
- Now in the Central Admin site (this is now created):
- Configure WSS search service
- Configure Office SharePoint search service
- Create web application
- Create site collection…etc.
using System;
using ASP = System.Web.UI.WebControls;
using System.Web;
using Microsoft.Office.InfoPath.Server.Controls;
namespace WMDD.WebParts
{
public class FormViewer : ASP.WebParts.WebPart
{
protected override void CreateChildControls()
{
XmlFormView formView;
formView = new XmlFormView();
formView.Width = ASP.Unit.Percentage(100);
formView.Height = ASP.Unit.Pixel(100);
formView.XsnLocation = “Path to form XSN”;
formView.ShowHeader = false;
formView.ShowFooter = false;
this.Controls.Add(formView);
base.CreateChildControls();
}
}
}
As I was playing with MOSS 2007 and ISA today, I wanted to publish a SharePoint subsite, without publishing the root site.
Since I’m not that experienced in ISA Server, I sometimes turned to Bart Bultinck (great guy, great systems engineer) on my MSN Messenger. He’s way more familiar and experienced with ISA Server.
So the situation is like this:
- In my Internal network you can access my portal (sub)site through http://moss/sharepoint
- In my external network you should be able to access the portal through http://sharepoint/sharepoint
(Sorry, my names aren’t that original, but who cares)
So how do you do it?
- Don’t forget to add an extra Alternate Access Mapping in MOSS. So I added an Internet Zone “http://sharepoint”
- Create a weblistener and a rule on your ISA Server to send through the SharePoint subsite.
- And most importantly, do not only allow the path /sharepoint/*, but also the following:
/_controltemplates/*
/_layouts/*
/_vti_bin/*
/_wpresources/*
When you develop actions (or workflows) that should be executed when an expiration policy occurs you need to test them, and that is problem in MOSS as the Expiration Policy job only is scheduled to run once a day. Probably you can’t sit around waiting all day for the job to run so you will have to force it’s execution.
My first though was that there ought to be some operation in STSADM.EXE that would support this. But I did not find any! If there are any operation for this please let me know!
I then reverted to building an application that will find the Expiration policy job and execute it. After looking through the classes and methods available this is the code I came up with:
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Microsoft.SharePoint.Administration;
namespace RunExpirationPolicy
{
class Program
{
static void Main(string[] args)
{
foreach (SPService srv in SPFarm.Local.Services)
{
foreach (SPJobDefinition job in srv.JobDefinitions)
{
string jobTitle = job.Title;
if (jobTitle == “Expiration policy”)
{
Trace.WriteLine(”***************** Start of execution for expiration policy job”);
job.Execute(Guid.Empty);
Trace.WriteLine(”***************** End of execution for expiration policy job”);
}
}
}
}
}
}
I think it’s simple and quite obvious what it does. The only thing that is not obvious is why there is a Guid.Empty as parameter, it is there because it is required but only has meaning in a specific case which does not apply here (read more on MSDN).
As I use this for debugging my custom actions I have included Trace calls which log the start and end of the execution of the Expiration job. During my tests so far I have received all the traces made by my custom action within the Start and End traces, if this is always true I don’t know but it works fine for me.
Step 1: Check Service Pack Level
The first thing to verify before you do anything is to check the service pack level of your current 2.0 SharePoint installation. I found that it was still running SP1 and had never been upgraded to SP2. This presented a huge problem. At a minimum your SharePoint 2.0 installation has to be at the SP2 level. If found this out when I had the database backed up and restored to my new database server and tried to attach it to MOSS 2007. It came back saying that the database was too old and couldn’t be upgraded. So if you get a similar error message, double check the service pack level for your 2.0 installation.
Step 2: PreScan
With the installation of Services 3.0 or MOSS 2007 comes a nice little utility to help you pre scan the 2.0 install for things that might cause errors when you migrate. You can find this utility on your 2007 server under <%root%>\program files\common files\Microsoft Shared\web service extenstions\12\bin directory. Transfer the EXE to your 2.0 server and kick it off from the command line. The command line statement “Prescan /all” will start the utility and have it start enumerating all of the sites on the box.
When it is complete it will put a log file in to your Documents/Local Files/Temp directory with information as to what it found. It details any errors that it encountered, it details lists that it re-organized, and also will give you details on page customizations and the like. Verify that there are no errors, If there are, fix them before you do the migration. Rerun the prescan utility after repairing any errors to be sure that things have been rectified and are good for migration.
Step 3: Backup/Restore
I didn’t have the opportunity to do this part of the operation. I had a fellow DBA do this part for me, but it did take quite a while. The issues he encountered here was that every time he tried to transport the backup files from one server to the next it kept on corrupting. So the solution was to use a compression utility to zip up all of the data and then transport it. That seemed to do the trick.
Step 4: Create New SharePoint Web Application
Now if you have been working with and configuring SharePoint 2007 then more than likely this will be second nature to you, but there is one little step that is a bit different here. When you create a new web application usually it will default to create a new content database usually with a name like “WSS_Content_<GUID>”. If we were just going to create a new web app this would be fine, but we are looking to attach a copy of the old WSS 2.0 database to this web application. So, replace the defaulted name of the database to the name of the newly migrated and restored database from the WSS 2.0 and let it rip.
SharePoint will take over and create the web application, but instead of creating a new content database it will upgrade the 2.0 database to the correct schema that 2007 uses. Once that is done you should be able to access your content through the new url root. I did go through and verify that it did bring over all of the content as well as the security settings for the sites.
Step 4b: I don’t want a new SharePoint Web Application
Okay, so what if you don’t want a new web application? Well you can always do the same thing by attaching the migrated database to an existing web application on the 2007 box. You can do this either by the content databases interface in Central administration OR you can do it with STSADM. I would recommend the STSADM method for the only purpose that when you do the attaching and upgrade the process can take a bit of time and can possibly time out the Central Administration operation. The only issue I found with this process of attaching and upgrading is that if your 2.0 site structure had a top site (which most of all will) it will not be pulled in and overwrite the current site collection of the existing web application. At least, I found that the content at the old top site I had couldn’t be accessed. So I chose to go the path of Step 4 above.
The STSADM command line statement looks a bit like this: stsadm –o addcontentdb –url <web application url> -databasename <database name> [there other optional switches you can add on if you would like but this is the base execution].
Well, I hope that this has proved useful for anyone in the need to do this type of upgrade. Again, during this process I didn’t have to really mitigate any major errors or deal with any major customizations that might have been done to the 2.0 installation. I guess I was lucky in that respect, but with other sites that might have 3rd party web parts or other customized parts you might want to really proof out the process you will use to do the migration.
private string GetSmtpServer()
{
SPWebApplicationCollection spWebApplicationCollection = SPWebService.ContentService.WebApplications;
SPOutboundMailServiceInstance smtpServer = new SPOutboundMailServiceInstance();if (spWebApplicationCollection != null)
{
foreach (SPWebApplication spWebApplication in spWebApplicationCollection) {
smtpServer = spWebApplication.OutboundMailServiceInstance;
return smtpServer.Server.Address;
}
}
return string.Empty;
}
“The Microsoft Filter Pack for search has been released enabling critical search scenarios across a variety of Microsoft Search products including SharePoint Portal Server 2003, Microsoft Office SharePoint Server 2007, Windows SharePoint Services 3.0, Search Server 2008, Search Server 2008 Express Edition, Exchange Server 2005, SQL Server 2005/2008, and Windows Desktop Search 3.1/4.0.
The Microsoft Filter Pack provides iFilters for the following file type extensions:
- .docx (Microsoft Office 2007 Word Document)
- .docm (Microsoft Office Word Macro-Enabled Document)
- .pptx (Microsoft Office 2007 PowerPoint Presentation)
- .xlsx (Microsoft Office 2007 Excel Worksheet)
- .xlsm (Microsoft Office Excel Macro-Enabled Worksheet)
- .xlsb (Microsoft Office Excel Binary Worksheet)
- .zip (WinZip File)
- .one (Microsoft Office OneNote Section)
- .vdx (Microsoft Office Visio Drawing)
- .vsd (Microsoft Office Visio Drawing)
- .vss (Microsoft Office Visio Stencil)
- .vst (Microsoft Office Visio Template)
- .vsx (Microsoft Office Visio Stencil)
- .vtx (Microsoft Office Visio Template)
You can run stsadm -o enumtemplates to verify that your template was added, and you’ll also notice that it’s been given a name like “_GLOBAL_#1″. If you’ve added a template to the Sharepoint Portal Server Template Gallery (#2 above) you’ll notice that this template is not listed when using stsadm.
Stsadm will not list the default templates either so I’ll list them here with Title and Name:
- Team Site, STS#0
- Blank Site, STS#1
- Document Workspace, STS#2
- Basic Meeting Workspace, MPS#0
- Blank Meeting Workspace, MPS#1
- Decision Meeting Workspace, MPS#2
- Social Meeting Workspace, MPS#3
- Multipage Meeting Workspace, MPS#4
- Business Activity Services Team Site, BAS#0
- SharePoint Portal Server Site, SPS#0
- SharePoint Portal Server Personal Space, SPSPERS#0
- SharePoint Portal Server My Site, SPSMSITE#0
- Contents area Template, SPSTOC#0
- Topic area template, SPSTOPIC#0
- News area template, SPSNEWS#0
- News Home area template, SPSNHOME#0
- Site Directory area template, SPSSITES#0
- SharePoint Portal Server BucketWeb Template, SPSBWEB#0
- Community area template, SPSCOMMU#0
- sitetemplate, _GLOBAL_#1 <- My custom template on the Virtual Server
To adjust the top level navigation in all My Sites do the following.
Add new links here that will be added to the top level navigation.
For the rules.
{
ServerContext context = ServerContext.GetContext(site);
AudienceManager AudMgr = new AudienceManager(context);
Audience a = null;
bool ruleListNotEmpty = false;
{
a = AudMgr.Audiences["Eddy and Ed Connection"];
}
catch (AudienceArgumentException ex)
{
//your exception handling code here
}
if (aRules == null)
{
aRules = new ArrayList();
}
else
{
ruleListNotEmpty = true;
}
{
//if the rule is not emply, start with a group operator ‘AND’ to append
if (ruleListNotEmpty)
{
aRules.Add(new AudienceRuleComponent(null, “AND”, null));
}
aRules.Add(r0);
aRules.Add(r1);
aRules.Add(r2);
aRules.Add(r3);
aRules.Add(r4);
aRules.Add(r5);
aRules.Add(r6);
aRules.Add(r7);
aRules.Add(r8);
aRules.Add(r9);
aRules.Add(r10);
a.AudienceRules = aRules;
a.Commit();
}
catch (AudienceException e)
{
//Your exception handling code here
}
}
}
