.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

ExecuteStatic is never called for MethodInstanceType.Updater

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :C#

I'm writing a custom BCS connector, so I wrote a class that implements ISystemUtility. ExecuteStatic gets called for Finder, Creator, Deleter, SpecificFinder but not for Updater. I do see the object property being updated (by setting a breakpoint in the setter of the property), so I think Sharepoint is updating the object internally, but I want to update it throgh Updater method instance type.

In sharepoint, I bound this BCS connector to an external list. I can see the Edit Item button, and when I click on it, it does open the proper edit window with all the read/write fields (except for the ID of course). When I click Save, the changes do reflect in the displayed list, but my connector doesn't get to do it's own updating because Updater never gets called.


View Complete Post

More Related Resource Links

Web Q&A: Who Called the Script?, Concatenating Binary Files, and More


This month find out which part of an HTML document has called a script, how to concatenate binary files, find a node, reference one script from another, build a GUI database front end in Access, and compare XML files.

Edited by Nancy Michell

MSDN Magazine August 2003

InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.


I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?


BCS Updater Method in External Content type


HI, I have a List (External Content type ) with CRUD methods written.for example. Employee with fields






If want to update only Remarks field and want to display the other fields.(other field should not be editable). How can i do it throught VS2010. If I made those fields readOnly and preupdaterField true. those fields not displays while editing. I want to show those fields but not to edit. any suggestions????

2)while displaying (ReadList )if I want to display only EmpName and EmpID.How can i do it?


or please try to give some links about all the properties for a Type Decriptor and how they are related with CRUD methods.



Trying to get SPSite when called through a web service


I have built a custom timer job that makes calls to a web service that I built.  The reason I built the web service is because I recognized that the sharepoint timer job does not have context for a site and I thought that by having the timer job call the web methods of the web service I could have the context that I desire.  This works great for accessing the web.config file, however, I have discovered that I am unable to get SPSite (SPSite oSite = new SPSite(AbsoluteURL)).  The constructor does not throw an error but I am unable to use the new object.  If I am able to get to the web.config and the site is a SharePoint site I figure I should be able to get an SPSite object.

I am trying to understand if I am running into a known scenario or if this should work and that I have a bug that I don't recognize.

WCF Service Function Getting Called Twice


I have a WCF Web Service.  I am trying to test the service from a web form.  The web form calls the service using WebOperationContext.  The call successfully sends, however the web service function gets called twice while stepping through the code.  Nothing happens in between the first and second function call.  Not even setup of the Service.  The function itself is building a Generic List<Of Type T> and adding objects to the list.  The odd thing that happens, if I do not make the call to the add function, the Service function doesn't get called twice.  I'm including the network log collected from the network layer.  I can provide more source code if need be.  

Custom Validation Attribute is not called by validation mechanism.

Hello everyone I have create custom validation attribute and assign it to class level validation. Unfortunately, it is not called. I try every way that it think it could be solve the problem. However, it take me for hours and I can't find the attribute is not called by validation mechanism.For illustrate you I put the following code.Attribute[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] public sealed class BooleanDependencyAttribute : ValidationAttribute { private const string _defaultErrorMessage = "?????????{0}"; private readonly object _typeId = new object(); public string DependencyPropertyName { get; private set; } public string DependentPropertyName { get; private set; } public BooleanDependencyAttribute(string dependencyPropertyName, string dependentPropertyName) : base(_defaultErrorMessage) { DependencyPropertyName = dependencyPropertyName; DependentPropertyName = dependentPropertyName; } public override object TypeId { get { return _typeId; } } public override string FormatErrorMessage(string name) { return String.Format(CultureInfo.CurrentUICulture, ErrorMessageString,name); } public override bool

Microsoft.ApplicationBlocks.Updater.Downloaders 64 bit error

Hello, I have a application that uses applicationblocks updater.  It works great on 32-bit machines, but when a 64-bit machines uses it I get the following error: Exception Source:      Microsoft.ApplicationBlocks.Updater.Downloaders Exception Type:        System.TypeLoadException Exception Message:     Could not load type 'Microsoft.ApplicationBlocks.Updater.Downloaders.BG_BASIC_CREDENTIALS' from assembly 'Microsoft.ApplicationBlocks.Updater.Downloaders, Version=, Culture=neutral, PublicKeyToken=null' because it contains an object field at offset 4 that is incorrectly aligned or overlapped by a non-object field. Exception Target Site: SetBackgroundJobCredentials ---- Stack Trace ----    Microsoft.ApplicationBlocks.Updater.Downloader.DownloadManager.SubmitTask(task As UpdaterTask, maxWaitTime As TimeSpan)    Microsoft.ApplicationBlocks.Updater.ApplicationUpdaterManager.Download(selectedManifests As Manifest[], maxWaitTime As TimeSpan) I used reflection to check out the BG_BASIC_CREDENTIALS class and it looks like this: <StructLayout (LayoutKind .Explicit , Size :=&H10 , Pack :=4 )> _ Friend Structure BG_AUTH_CREDENTIALS ' Fields <FieldOffset (8 )> _ Public Credentials As BG_AUTH_CREDENTIALS_UNION <FieldOffset (4 )> _ Pu

DataGrid ValidationRule or IDataErrorInfo validation code called multiple times for each data change

Following my enquiry regarding a problem in Datagrid validation, for which managing exceptions is apparently a problem, I tested the two other methods: using validation rules, or implementing the IDataErrorInfo interface. I ran into other problems there, more insidious this time. This has been done on Windows7 (32-bit), .NET 4.0.30319. 1) IDataErrorInfo When this interface is implemented, the this[string columnName] property is called four times for each modification: two times before the cell enters edit mode (with the old value in the corresponding property) two times when the new value has to be validated (with the new value) It strikes me as not really efficient, is there something wrong with my code? Here's the C# part: using System; using System.Windows; using System.Collections.ObjectModel; using System.ComponentModel; namespace DataGridTest2 { public partial class MainWindow : Window { ObservableCollection<User> users; public MainWindow() { InitializeComponent(); users = new ObservableCollection<User>() { new User { Name = "Teddy", Age = "2" }, new User { Name = "Avi", Age = "19" } }; datagrid.ItemsSource = users; datagrid.Focus(); } } public class User : INotifyPropertyChanged, IDataErrorInfo { string name; public string Name

ViewBase.ClearItem is never called

Hello, I'm currently playing with ListView.View property and the associated ViewBase class and during my tests I discover that my override of the ViewBase.ClearItem method is never called when I remove items from the source items of the ListView. Does someone has any clue about when the ClearItem method is called? How can I, in my ViewBase class, manage the suppression of some elements in the initial list? Thanks in advance for your answers! To illustrate this issue, I have created a sample application composed of a Window with two buttons and a list view: The list view is initialized with three values The first button ("remove") removes the last entry of the source The second button ("clear") removes all the elements of the list by calling the Clear() method The list view is associated to a ViewBase implementation that only trace method calls to the console Finally, I run the sample and have three calls of the PrepareItem method visible on the console. After that I click on the first and second button, the list is updated but the ClearItem method of the ViewBase was never been called. Here is a sample source code: First of all the XAML (MainWindow.xaml): <Window x:Class="Poc.ViewBaseIssue.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.c

OnPreRender method is Not called last because of objectDataSource

I have an Asp.net web form with several drop down list boxes on it. The way the code is currently set up is that the drop down listboxes are populated through use of an ObjectDataSource via a class named SpottedWeb, as referred to by the TypeName attribute. The problem is that sometimes I need to pre-select drop down list box items, but the ObjectDataSource seems to have the last say in loading the drop down listboxes. So any attempt to pre-select drop down listbox items is undone when my .Aspx code is executed. My attempt to fix this involved creating an OnPreRender method, because I thought it would have the last say with populating my listboxes. But this is not the case.So is there a way that I can have the OnPreRender method or some other C# method be called after the .Aspx page loads my drop downs with the objectDataSource? // Here is my OnPreRender method.         protected override void OnPreRender(EventArgs e)        {            base.OnPreRender(e);             if (Session["Indicator"] != null)            {                PrePopulateWebForm(); // Pre-Sele

How can I know that LoadingRowDetails will not be called?

Hello, I wan't to set this.Cursor = Cursor.Wait in the SelectionChanged event of a DataGrid, then when a (sometimes lengthy) process of loading the RowDetails is finished, set this.Cursor = Cursor.Arrow. Problem is that the LoadingRowDetails event is only called the first time the row is loaded. So I have 2 questions: 1. How can I know if LoadingRowDetails will be called or not? 2. Why does is take so long to load the row details if I put the a DataGrid inside of an Expander (see XAML below)?   Thanks, Bill MSDN Subscriber

Fail to create window in C++ DLL called from C#

Can anyone help here, please? http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/5b47544c-8151-4c8a-a8c3-14fbeabbbb41 Thanks in advance.

When is Application_BeginRequest called?

I have two versions of a website. One runs on IIS server on a local PC, the other runs on the ASP.NET development environment included on Visual Studio (localhost). Apart from that, the file stucture of both is the same, although only the one running on IIS works properly, and this seems to be related to the fact that the IIS version calls Application_BeginRequest() where the other doesn't.I've looked at the differences between IIS server and the ASP development environment in: http://www.asp.net/hosting/tutorials/core-differences-between-iis-and-the-asp-net-development-server-cs, and it says that IIS and the ASP development server deal with static content in that for IIS in that on IIS static content does not go through the ASP.NET runtime like it does on the dev environment (but I'm not sure exactly what this means).I've done a number of tests involving images, etc, and have noticed that when the image is of the form:<img src="Image/MyImage.jpg...>the IIS server version calls Application_BeginRequest(), but the visual studio development environment version doesn't. However, if I change the above code to use:<img src="<%=ResolveUrl("~/Image/MyImage.jpg")%>" ...>it will call Application_BeginRequest().In my case, it is necessary to call Application_BeginRequest because this creates a new path and calls RewritePa

How to read a file without "disturbing" file updater

Hi, I have written a small tool that responds to that logfiles are updated. I use:   FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) Which - according to my knowledge - is the way to read a file without disturbing other users of the file. But when I run this program, writers to this file may fial and I need to avoid this by all means. Do you know, what I am doing wrong? It should be said, that I use FileSystemWatcher in order to detect if the file is updateed or not. Can that be the reason? TIA Best regards Soeren D.

Javascript not getting called

Hi All, I am passing values from javascript to another url. In my javascript function, i just added one more parameter called docID. Earlier, without it, all the remaining values being passed were showing their values properly. But DocID when added, in the quickwatch it shows as docID&rwndrnd=0.3228507973801712 instead of my actual docid value. Can anybody please help me and tell me why is it that the docID value is not coming correctly? Also, when I debug the javascript function is not getting called so I cannot see what value is getting assigned to the docID. How do I enter the javascript function while debugging? emailWindow.SetUrl(   "emailDocs.aspx?tab=account&docClass=UWPolicyFile&policyNumber=" + policyNumber + "&symbol=" + symbol + "&mod=" + mod + "&docID=" + docID); Thanks, Mavericky    

SSRS Called from API

Hi, I have recently started working on SSRS. I have developed some reports on SSRS, which i had to deploy it some server. What i need to do is to generate reports using SSRS directly form the API and not deploying that separately. What i mean to say is, suppose i have some report names on the aspx page of application, and when user clicks on the report name the application would generate report using the SSRS. Can anyone please suggest me an advice? It would great if you can give the link where i can find a simple example on this. Thanks in advance.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend