DCSIMG
.Net - Dudi Nissan's Blog

Dudi Nissan's Blog

SharePoint, ASP .Net, SQL

Links

SharePoint 2010 Custom Fields

Browse by Tags

All Tags » .Net (RSS)
Change Web Reference Url Dynamically Issue
ב-Net. ניתן לשנות את ה-URL של ה- Web Reference בזמן ריצה בקוד באופן דינמי. במידה וכתובת ה-web reference כולל WSDL, אם מבצעים שינוי בזמן ריצה, אין לכלול את ה-WSDL ב-url עצמו. לדוגמא: הוספת web reference לשרת הפיתוח: הוספת web reference לשרת ה-Production: הקוד בזמן ריצה: MyService Service_ = new MyService (); // Do not include wsdl in the url // Service_.Url = "...asmx" ; // Correct without "?wsdl" Service_.Url = "...asmx?wsdl" ; // Incorrect
SharePoint 2013: Custom Web Service
SharePoint 2013 באמצעות Visual Studio 2012, מאפשר ליצור Custom Web Service לפי הצורך. להלן השלבים: 1. יצירת פרוייקט מסוג SharePoint 2013 - Empty Project 2. הוספת פריט מסוג Windows Service 3.קוד לדוגמא של ה-class using System.Web.Services; using Microsoft.SharePoint; [ WebService (Namespace = http://tempuri.org/ )] [ WebServiceBinding (ConformsTo = WsiProfiles .BasicProfile1_1)] public class SP2013Service : System.Web.Services. WebService { public SP2013Service() { } [ WebMethod ] public string Temp...
Posted: Feb 12 2013, 04:25 AM by dudin | with no comments
תגים:, ,
Windows Store App: How to Loop through XML by Code
דוגמא ל"ריצה" על קובץ XML בפרוייקט Windows Store App: string XmlUrl = " http://www.../file.xml " ; Uri Uri_ = new Uri (XmlUrl); Windows.Data.Xml.Dom. XmlDocument xmlDocument = await Windows.Data.Xml.Dom. XmlDocument .LoadFromUriAsync(Uri_); Windows.Data.Xml.Dom. XmlNodeList Items = xmlDocument.SelectNodes( "NodeName" ); string NodeText = "" ; foreach (Windows.Data.Xml.Dom. IXmlNode Item in Items) { NodeText = Item.SelectSingleNode( "ITEM_NAME" ).InnerText;...
Windows 8 Store app: How to Consume Service Reference in Visual Studio 2012
דוגמאות של "קטע" קוד לשימוש ב-Service Refernce - קובץ xaml.cs: פרוייקט Windows Store app public MainPage() { this .InitializeComponent(); this .Loaded += MainPage_Loaded; } private async void MainPage_Loaded( object sender, RoutedEventArgs e) { App1.ServiceReference1. Service1Client Service1Client_ = new App1.ServiceReference1. Service1Client (); System.Collections.ObjectModel. ObservableCollection < string > Results = await Service1Client_.InboxAsync(); // Logic code // } פרוייקט...
SharePoint 2010: How to Hide 'Title' Field in Custom List by Code
ברשימה מותאמת אישית (Custom List) ב-SharePoint 2010, לעתים קיים צורך לא להציג את שדה "כותרת" (Title) שהוא שדה ברירת המחדל של הרשימה מסוג זה. ניתן להסתיר את השדה באמצעות קוד לדוגמא (יש לשנות את הגדרות השדה טרם הרצת הקוד: שינוי הערך ל-No בהגדרה Require that this column contains information): using (Microsoft.SharePoint. SPSite site = new Microsoft.SharePoint. SPSite ( "SiteUrl" )) { site.CatchAccessDeniedException = true ; site.AllowUnsafeUpdates = true ; using (Microsoft.SharePoint...
Posted: Nov 27 2012, 09:56 AM by dudin | with no comments
תגים:, ,
SharePoint 2010: How to Get int Value from Numer Field When Using SPSiteDataQuery
בשימוש ברכיב SPSiteDataQuery ב-SharePoint 2010 ל"שליפת" ערכים משדה מסוג Numeric, הערך אשר חוזר מהרכיב הינו מסוג Text ולא int. להלן דוגמת קוד של "שליפת" הנתונים והמרה מ-Text ל-int: using (Microsoft.SharePoint. SPSite Site_ = new Microsoft.SharePoint. SPSite ( "Site_URL" )) { using (Microsoft.SharePoint. SPWeb Web_ = Site_.OpenWeb()) { Microsoft.SharePoint. SPSiteDataQuery Query_ = new Microsoft.SharePoint. SPSiteDataQuery (); Query_.Lists = "<Lists ServerTemplate...
Posted: Nov 19 2012, 03:46 AM by dudin | with no comments
תגים:, ,
SharePoint 2010: Web Browsable Property not Displayed in Visual Web Part
נתקלתי בבעיה ב-Visual Web Part של SharePoint 2010, שבה Web Browserable Property לא הוצג במאפייני ה-Web Part. חלק מקוד לדוגמא: [ WebBrowsable ( true ), Category ( "Settings" ), Personalizable ( PersonalizationScope .Shared), Microsoft.SharePoint.WebPartPages. WebPartStorage (Microsoft.SharePoint.WebPartPages. Storage .Shared), WebDisplayName ( "URL" ), WebDescription ( "URL" )] public static string URL { get ; set ; } הפתרון [ WebBrowsable ( true ), Category ( "Settings"...
Posted: Nov 07 2012, 01:24 PM by dudin | with no comments
תגים:, ,
SharePoint 2010: <nativehr>0x80020009</nativehr><nativestack></nativestack> message when using SPSiteDataQuery
נתקלתי בהודעת שגיאה בשימוש SPSiteDataQuery ב-SharePoint 2010: <nativehr>0x80020009</nativehr><nativestack></nativestack> קוד לדוגמא using (Microsoft.SharePoint. SPSite Site_ = new Microsoft.SharePoint. SPSite ( "Site_URL" )) { using (Microsoft.SharePoint. SPWeb Web_ = Site_.OpenWeb()) { Microsoft.SharePoint. SPSiteDataQuery Query_ = new Microsoft.SharePoint. SPSiteDataQuery (); Query_.Lists = "<Lists ServerTemplate='101' />" ; Query_.ViewFields...
Posted: Aug 22 2012, 09:57 AM by dudin | with no comments
תגים:, ,
Free ebook: Programming Windows 8 Apps with HTML, CSS, and JavaScript
הורדה חינם של ebook בנושא Programming Windows 8 Apps with HTML, CSS, and JavaScript כאן ניתן לראות את רשימת כל ה-Free ebooks כאן
Posted: Jun 28 2012, 10:18 AM by dudin | with no comments
תגים:,
SharePoint 2010: How to Set Default Calculated Value to DateTime Column by Code
SharePoint 2010 מאפשר להגדיר תאריך ברירת מחדל ספציפי לשדה DateTime באמצעות קוד. לדוגמא (הקוד הבא יגרום לכך שתאריך ברירת המחדל בשדה DateTime יהיו 17/5/2012, כיוון שהקוד "רץ" בתאריך זה לצורך הדוגמא): using ( SPSite site = new SPSite ( http://siteurl/ )) { using ( SPWeb web = site.OpenWeb()) { SPList list = web.Lists.TryGetList( "ListName" ); if (list != null ) { SPField fld = list.Fields[ "FieldName" ]; fld.DefaultFormula = "=DATEVALUE(\"" + DateTime .Today...
Posted: May 17 2012, 06:16 PM by dudin | with no comments
תגים:, ,
Error 403 when using WebRequest.GetResponse
נתקלתי בהודעת שגיאה Error 403 בשימוש בפונקציה GetResponses של WebRequest. להלן דוגמא של הקוד: string SiteUrl = "http://..." ; System.Net. WebRequest WebRequest_ = System.Net. WebRequest .Create( new Uri (SiteUrl)); System.Net. WebResponse WebResponse_ = WebRequest_.GetResponse(); // Error 403 // הפתרון השרת בו רץ הקוד פונה לאינטרנט באמצעות שרת Proxy: הוספת הגדרה של שרת ה-Proxy בקוד פתרה את הבעיה: WebRequest_.Proxy = new WebProxy ( "ProxyIP" , 80);
Posted: Mar 21 2012, 05:38 PM by dudin | with no comments
תגים:,
InfoPath 2010: How to Loop through XPathNavigator Childrens
להלן דוגמא של קוד: string ListName = "DataSourceName" ; string FieldName = "SharePointListItem_RW" ; XPathNavigator _rootNode = this .DataSources[ListName].CreateNavigator(); XPathNodeIterator nodes = _rootNode.Select ( "/dfs:myFields/dfs:dataFields/d:" + FieldName, this .NamespaceManager); string Value = "" ; string LocalName = "" ; while (nodes.MoveNext()) { if (nodes.Current.HasChildren == true ) { // Move to the first child. nodes.Current.MoveToFirstChild...
Posted: Mar 15 2012, 09:42 PM by dudin | with no comments
תגים:, ,
VSTA: InfoPath 2010 Converter.ConverterException
בתכנות VSTA בפרוייקט של InfoPath 2010 (מציג את הטופס בדפדפן), נתקלתי בפונקציה InternalStartup בהודעת שגיאה: Microsoft.Office.InfoPath.Server.Converter.ConverterException בקוד הבא: XPathNavigator xnMyForm = this.CreateNavigator(); זאת הודעת השגיאה בביצוע העלאת קובץ ה-XSN לשרת: הפתרון לכתוב את הקוד של יצירת רכיב CreateNavigator בפונקציה FormEvents ולא בפונקציה InternalStartup.
Posted: Mar 12 2012, 11:06 PM by dudin | with no comments
תגים:, ,
Windows Phone SDK Install Message: Visual Studio setup cannot run in compatibility mode. For more information see the 'Installing' section in the Visual Studio
בהתקנת Windows Phone SDK עבור Visual Studio 2010, הוצגה ההודעה הבאה ותהליך ההתקנה לא הושלם: Visual Studio setup cannot run in compatibility mode. For more information see the 'Installing' section in the Visual Studio. Readme at " http://go.microsoft.com/fwlink/?LinkId=143397 " הפתרון אפשרות א' - לא פתר את הבעיה במקרה הספציפי בו נתקלתי. ביצוע ההוראות אשר כתובות במאמר באתר מיקרוסופט: אפשרות ב' - פתרה את הבעיה: הורדה והתקנה של הגירסה המלאה של Windows Phone SDK כאן
Posted: Feb 20 2012, 12:07 PM by dudin | with no comments
תגים:,
SharePoint 2010: How to Check if Field Value Changed in List Event Receiver
אחת הדרכים לבדוק ב- SPItemEventProperties , אם ערך של שדה השתנה לאחר עדכון רשימה היא באופן הבא: public override void ItemUpdating( SPItemEventProperties properties) { base .ItemUpdating(properties); string FieldName = "Title" ; if ( string .Compare(properties.BeforeProperties[FieldName].ToString(), properties.AfterProperties[FieldName].ToString()) != 0) { // do some logic } }
Posted: Feb 07 2012, 01:34 PM by dudin | with no comments
תגים:, ,
More Posts Next page »