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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Update a WPF Form from an object within a BackgroundWorker

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :WPF
 

Hello together,

I got stuck. :(  I want to capture a lot of images from a camera and after every new image, my UI should be updated ...

There is a Camera class (singleton) with a Capture method. This is doing the capturing of the data and stores them into an array. If I start now a measuring, a WPF form (e.g. with an image control and an abort button) should open and start the capturing of the images in the background. This is not a problem. But if I want to update the image control after every new image, my Camera.Capture method has to "inform" the form about that. But how? It tried to pass a delegate to the Camera.Capture method. But if this is called, it throws a System.Reflection.TargetInvocationException.

What is the "right / best" way to do this?

 

Thank you,

Mike




View Complete Post


More Related Resource Links

Update web form using custom events.

  

How can I update UI of web form via event?

I have 2 buttons on page, where button1.visible = false.


Page code behind:

     protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                Class1.ShowButtonEvent += new Class1.ShowButton(Show);
            }
        }
    
&nb

Using ajax to submit and update form

  

Hi all,

  I'm new to ajax and not sure if it's necessarily the technology I need to accompolish what I'm looking to do. What I'd like to have is a simple two textbox and button form that let's the user submit some credentials (not for logging in) but instead to verify their identity for other purposes.  I would label the button as "Continue" and assuming it passes through, the form would update with some new data entry controls that would allow them to submit some final information.  I thought perhaps ajax would be a nice way to do this since I wouldn't need to create a second continuation page from the first to display a new form.  However, I'm unsure how it's possible to update the form in the first place to look different.  Or is there perhaps a cleaner way to do this?  Any help would be appreciated.  Thanks


How to update client asp.net form periodically?

  
Hi all, I am fresh new to asp.net.  I try to convert my windows form into asp.net application. On my Windows form I use threads to monitor for changes in data sources to udpate my controls. However, I got no clue how to accomplish this in asp.net form.  It seems I cannot create a thread in the page to update my controls in the page.  I realy appreciate for any comments   Thanks

making page work after DB update in Form View

  
I could really use some help with this issue. I have a DropDown that allows the selection of a Category Code. The selection populates a Gridview with details of records matching the Category Code. I have only enabled the Select option on the Gridview, which when clicked populates a Formview in Edit Mode with the full record information. When editing is complete and the Update link is clicked, I can not get the page to properly reload/postback. When another Category Code is selected from the Drop Down the Gridview does not report a list of records.   Any help would be greatly appreciated.   Thanks,              

How to prevent automatic update from sharepoint list on Infopath 2007 form

  
Hi there, I've got an Infopath 2007 form on MOSS 2007. I have a custom list in sharepoint and the infopath form has a data connection to that list to receive data. Is there any way to prevent automatic update on the values in the form that is received from the list. I'd like the new form to have updated info received from the list. However, the old/existing forms that were created should have the data that were available at the time when the form was created. Let me know if this is not clear and I'll try to explain more. Thanks,Pman http://www.pmansLab.com/

Client Object Model - update metadata

  
Is there a way that I can update the metadata for a document in a document list using a UniqueId without having to speciify the library name? If I know the library name and the ID I know how to update the metadata but what I was hoping was that there would be a way of doing it using a UniqueId without knowing exactly which Library the document is in.

How to Pass a Grid an EF Object and have it edit/update etc. without postbacks until save?

  
Hey all.Here's what I'm trying to do:I want to pull an EF object, or create a new one. Pass it to javascript (jquery or some such) and then have the grid bind on the client side and do everything client side from that point forward. (edits, validation etc.) Once complete, I want jquery to push back via a pagemethod or web service or whatever, the updated EF object so that i can persist it.Reason?I need a highly scalable architecture that handles not storing objects in the session or posting to a database when they haven't been saved to a user. I know I can do this with Silverlight, however given MS's less than convincing comments about Silverlight's future vs HTML 5, I'm strongly leaning towards asp.net or mvc.net if I can come up with a way to use jquery (or even a 3rd party control that does this!) to handle all of the data editing, updating etc. for a master/child display (i.e. Invoice) without the server having to store it and without having to use the viewstate.Ideas?In my mind this would be the holly grail. Render the page, push the data to the controls, have the controls do their thing until save without ever doing server processing, and then on save, push back the object and allow the server to persist it (and probably do server validation before presisting it just in case). By doing this you could make superscalable apps that

Update producing invalid object name for temp table

  
If IWantThisDSN = 0 Then SQLString = "SELECT importparamsID, ESubmitType, Description, ImportFileName,ClientCode, Notes00, Notes01, Notes02, Notes03, Notes04 into #t0 from Importparams " Else SQLString = "SELECT importparamsID, ESubmitType, Description, ImportFileName, ClientCode, Notes00, Notes01, Notes02, Notes03, Notes04 into #t0 from Importparams " End If cn.Execute(SQLString) SQLString = "UPDATE #t0 Set Description = ' ' WHERE Description IS NULL" cn.Execute(SQLString) I'm getting the error in the last cn.Execute(SQLString) line...   Message=[Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name '#t0'. I'm using VB 2010 and SQL Server 2008. This worked fine before with VB 6 and SQL Server 2000 but with the "upgrade" it's not working... If you need any more info let me know what I may have left out.  Thanks!

Client Object Model : Transactional update of list and content types

  
I am using Silverlight client object model to code against Sharepoint. Essentially, what I want is that when a user clicks a button, An item needs to be added to a list and also a new content type has to be created. button1_click() { //1. Create an item in a list. //2.  Create a new content type. } Also this should be transactional:  only if item is added should the content type be added too, otherwise roll back both. (and vice-versa). My understanding of client object model is that we at the core we are talking to Sharepoint WCF services. So if I say, using(TransactionScope scope = new TransactionScope()) { ClientContext.ExecuteQueryAsync(); scope.Complete(); } can I assume that the updation will be transactional??

EF 4 object update error

  
Hi All, I have an entity type called SystemUser. I want to update a SystemUser object and for that I use the following method:  public int InactivateSystemUser(int userId)        {            ISystemUserRepository repository = RepositoryFacade.GetSystemUserRepository();            SystemUser user = repository.GetObjectByKey<SystemUser>(userId);            //deactivate user            user.FkUserCategory = 0;            DataContext.ObjectStateManager.ChangeObjectState(user, EntityState.Modified);            int result = DataContext.SaveChanges();            return result;        } Here when I do the update I get the error: "The ObjectStateManager does not contain an ObjectStateEntry with a reference to an object of type 'FMSI.Model.Data.SystemUser'." Could someone please advice me on how to correct this?    

How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object m

  

How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object model ??

This is my code :

ClientContext clientContext = ClientContext.Current;
                Web oWebsite = clientContext.Web;
                ListCollection collList = oWebsite.Lists;
                ListItem oListItem;

                List oList = clientContext.Web.Lists.GetByTitle("Employees");

                oListItem = oList.AddItem(new ListItemCreationInformation());
                oListItem["Title"] = "My new item";

oListItem["Geography"] = "Kroea";//This is MetaData Field

oListItem.Update();

 

the oListItem["Geography"] = "Kroea" must be formatted like oListItem["Geography"] = "2;#Kroea",that code will be worked.

The "2

How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object m

  

How to Add&Update the value of manage metadata field in Silverlight using sharepoint client object model ??

This is my code :

ClientContext clientContext = ClientContext.Current;
                Web oWebsite = clientContext.Web;
                ListCollection collList = oWebsite.Lists;
                ListItem oListItem;

                List oList = clientContext.Web.Lists.GetByTitle("Employees");

                oListItem = oList.AddItem(new ListItemCreationInformation());
                oListItem["Title"] = "My new item";

oListItem["Geography"] = "Kroea";//This is MetaData Field

oListItem.Update();

 

the oListItem["Geography"] = "Kroea" must be formatted like oListItem["Geography"] = "2;#Kroea",that code will be worked.

The "2

How to get nodes based on some values, update other element or delete that whole object

  

Hi,

This is my xml string.

<xml version="1.0" encoding="utf-16">
<objA>
    <x> test value 1 </x>
    <y> test value 2</y>

    <objB>
        <x> test value 3</x>
        <y> test value 4</y>

            <objA>
                <x> test value 5</x>
                <y> test value 6 </y>
            </objA>

            <objA>
                <x> test value 7</x>
                <y> test value 8 </y>

                <objB>
                    <x> test value 9</x>
                    <y> test value 6</y>
                </objB>

            </objA>

    </objB>

</objA>


</xml>


 

 

I have a big xml same as above containing a deep hierarchy.

Now, I am looking to do two things.

1. I want to find a particular node/obj by checking <x> element value. so I want to get node ofwhich <x> value is "test value 3" and for that object, I want to update <y> value to "Some New Value".

2. I want to find all the nodes/objects by checking <y> element value is "test value 6" OR "test value 8" OR "test value

page inside update panel doesn't refresh the session object after postback of any control

  

Hi,

I have many controls like dropdown, radiobuttonlist, etc on my page and I put all these controls inside the update panel so that the page doesn't look to be posting back when something is selected. Now the working on the page is very smooth. But the session object isn't getting refreshed even if I postback to the server and as a result even if the users are working on the page they are being sent to the login screen after 20 mins.

Is there anyway where I could put all the controls in update panel and still refresh the session after any postback(dropdown selection)

Any help is greatly appreciated.

Thanks in advance


How to update value directly in class Object using Linq

  

Hi,

I have a class object which is basically kind of hierarchy and looks like this when I convert that to XML.

===================================================================================

<ObjectComponent>
  	<SKU>SKU 1</SKU> 
	<IsBundle>true</IsBundle> 
	<Quantity>4</Quantity> 
	<ConfigurationStatus>Not Configurable</ConfigurationStatus> 
	<ObjectBundle>
		<ObjectComponent>
  			<SKU>SKU 2</SKU> 
  			<IsBundle>true</IsBundle> 
  			<Quantity>4</Quantity> 
  			<ConfigurationStatus>Not Configurable</ConfigurationStatus> 
			<ObjectBundle>
				<ObjectComponent>
  					<SKU>SKU 3</SKU> 
		  			<IsBundle>true</IsBundle> 
  					<Quantity>4</Quantity> 
		  			<ConfigurationStatus>Not Configurable</ConfigurationStatus> 
  				</ObjectComponent>
			</ObjectBundle>
  		</ObjectComponent>
	</ObjectBundle>
</ObjectComponent>


 

===================================================================================

So you can see that I have "objectComponent" which is kind of hierarchy and that hierarchy can be upto any level.

Now I need to update <quantity> value where <sk

Programmatic update of InfoPath form XML is stripping off tags

  

Hello,

I have a C# program that is looping through all of the forms (browser enabled) in my forms library and injecting an XML node into each of them (for a newly promoted field).  For some reason, when the XML is saved back to the form, the first few tags are being stripped off.  Specifically, these tags are:

<?xml version="1.0"?>
<?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:Contractor-DB-Form:-myXSD-2009-09-10T18-19-55" solutionVersion="1.0.1.1100" productVersion="12.0.0.0" PIVersion="1.0.0.0" href="http://echouat.rbs.us/npe/FormServerTemplates/Contractor_DB_Form.xsn"?>
<?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?>
<?mso-infoPath-file-attachment-present?>

My code to update the XML is as follows:

        private static SPListItem InsertXmlNode(SPListItem infoPathForm, string nodeToUpdateStr, string nodeToInsertStr,
            string nodeInnerXmlStr, string firstNode)
        {
            //load form into xml document
       

UPDATE STATISTICS - Could not allocate space for object - Tempdb

  

Hi Everyone

I have scheduled a maintenance plan for index & update stats one after another.  Now-a-days this job is failing with below error.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error Number: -1073548784

Executing the query "UPDATE STATISTICS [dbo].[***********]
WITH FULLSCAN
" failed with the following error: "Could not allocate space for object 'dbo.SORT temporary run
storage:  142101814116352' in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tables & Index Details

name rows reserved data index_size unused

*** 46613190 44534360 KB 37240624 KB 7293248 KB 488 KB

Categories: 
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