'System.InvalidOperationException'

TheMSsForum.com: The Microsoft Software Forum

  • The MSS Forum ‹ Framework
    • Archive
      • Biz
      • MCSE
      • CRM
      • Drivers
      • Framework
      • ADO
      • ASP
      • Compact
      • Forms
      • Dotnet
      • C#
      • VB
      • FontpageGen
      • Excel
      • WorkSheet
      • Exchange
      • Setup
      • Fox
      • Fontpage
      • ASP
      • IIS
      • Entourage
      • Money
      • Messanger
      • PocketPC
      • Powerpoint
      • Project
      • Publisher
      • Excel
      • VB
      • Security
      • Portal
      • Services
      • SQLServerDev
      • SVCS
      • SQLServer
      • VB
      • VC
      • MFC
      • ExcelGen
    • Previous
      • 1
        • unrecognized attribute xmlns I get this error accessing a 2.0 site on a web server previously running .net v1.1. I've installed v2.0. I've run aspnet_regiis -i. I've changed the ASP.NET version on the ASP.NET tab in IIS. But it still uses the v1.1 framework. Any suggestions? Tag: 'System.InvalidOperationException' Tag: 120793
      • 2
        • Diagnosing System.IO.IOException I have an application that generates and moves 1000s of small text files. Every so often for some unknow reason I start to get the following 2 exceptions: System.IO.IOException: Not enough quota is available to process this command. at System.IO.Directory.GetFiles(String path, String searchPattern) and (if the first exception does not happen we get a bit further and try to move the files we found) System.IO.IOException: Insufficient system resources exist to complete the requested service. at System.IO.File.Move(String sourceFileName, String destFileName) I can see no problems with available memory, the app does not use huge chunks of resources as far as I can tell from taskman and process explorer, restarting the application clears the problem. Load on the app does not seem to cause it as I can hit it VERY hard and it does not fail.. this leads me to think it is down to another application or the OS. Has anyone else seen this or got any good ideas on how to track the cause? Tag: 'System.InvalidOperationException' Tag: 120789
      • 3
        • DataTable.Select Aggreate function Hi Newsgroup I've the following problem: i have a statement on a DataTable thats looks like: BKD.Select(string.Format("{0} = MIN({0}) AND {1} = {2} AND {3} = {4}", BKD.PeriodeVon.ColumnName, BKD.HerkunftsRefNr.ColumnName, rowBKD.HerkunftsRefNr, tmBKD.BKD.StatusCd.ColumnName, BKDStatusCd.Differenziert) I always get an Array back with length zero but the Data i'm looking for are in the DataSet. Is it not possible to do an aggregate function and other filtering in the same statement? Thanks in advance Stefan Tag: 'System.InvalidOperationException' Tag: 120782
      • 4
        • Not able to run Quick start application in Enterprise library 2.0 Hi, I just read the article about Enterprise Library 2.0 , well its intresting and am new to it ... and happen to see the examples that was given in quick startapplicaion about Caching Application Block. Cryptography Application Block. Data Access Application Block. and others too.. but when i run the application like (Open-> website->CS (caching program) , and i re-built it and when i run it the page displays: [CODE] Directory Listing -- /CS/ -------------------------------------------------------------------------------- Monday, August 14, 2006 02:37 PM <dir> CryptographyQuickStart Thursday, January 05, 2006 09:58 AM 3,600 CryptographyQuickStart.sln Tuesday, August 22, 2006 07:24 PM 1,585 Web.Config -------------------------------------------------------------------------------- Version Information: ASP.NET Development Server 8.0.0.0 [/CODE] why is that ..? this happens for all the quick start samples... waiting for ur reply ... Tag: 'System.InvalidOperationException' Tag: 120780
      • 5
        • Dns resolve failure http://www.codeproject.com/vb/net/VbNetExpTree.asp 3:41 today (23/8/06) Tag: 'System.InvalidOperationException' Tag: 120779
      • 6
        • system.badimageformatexception returned from custom installer I have a web project that I have converted from VS 2003 to VS 2005. The installer is configured to use detect a newer version and if found to uninstall the old version before installing the new version. The installer in the new version VS 2005 contains custom actions that are compiled with VS 2005. For launch conditions, I have configured the .NET Framework to be at 2.0.50727 and Allow Later Version si set to True. When I run the installer I receive the system.badimageformatexception which references the dll that contains the custom installer code. If I uninstall the 2003 version of the software and then do an install of the 2005 version everything works fine. But if I have the 2003 version installed and then run the installer for the 2005 version I receive the error about the bad image. Is this a bug? Am I doing something wrong? Are there workarounds? Will my customers have to uninstall the old version manually before installing the new version? Thanks, Leslie Tag: 'System.InvalidOperationException' Tag: 120777
      • 7
        • Credientials to an HTTP POST request. I am trying to post an HTTP request to a site that requires a user name and password. I am trying the following: objRequest = DirectCast(System.Net.HttpWebRequest.Create(urlString), System.Net.HttpWebRequest) Dim credentials As New CredentialCache() credentials.Add(New Uri(urlString), "Basic", New NetworkCredential("user", "password")) 'Dim credentials As NetworkCredential = New NetworkCredential() objRequest.Credentials = credentials But using Fiddler I don't see any of the security authorization header information so I am wondering if the user name and password is getting passed. First does the above look correct? Thank you. Kevin Tag: 'System.InvalidOperationException' Tag: 120776
      • 8
        • Problem with simple calculation I am currently using the following Studio 2005: 8.0.50727.42 (RTM.050727-4200) .NET Framework: Version 2.0.50727 When doing the following in C# double a = 11.08; double b = 11.04; double c = a - b; I get 0.0400000000000009 instead of 0.04. Why is this? Am i missing something? Thanks Tag: 'System.InvalidOperationException' Tag: 120771
      • 9
        • System.Net.Mail.SmtpClient I am using SmtpClient.Send method to send emails from a windows service running under LoacalSystem credential. This program does not receive an exception when the Send method is called for a bogus email address. I am using my email address as FromAddress. The Host property is referencing a SMTP server on the network. I receive a delivery failure email in my Inbox. How can make it work so that I receive a SmtpFailedRecipientsException when the target email address is invalid? Thanks. Tag: 'System.InvalidOperationException' Tag: 120768
      • 10
        • saving common settings/data without administrative privileges I am trying to find a way to save common data in my program that will not change from different users. I tried both HKEY_LOCAL_MACHINE and writting to an ini file and storing it in my Program directory. However, in order for this to work, all the users need administrative privileges. Is there a proper way to store common data that I am not aware of? For example, I have a test number that I need to increment. And this test number must not change when the user changes. Tag: 'System.InvalidOperationException' Tag: 120760
      • 11
        • Windows Service project and how to debug Hi, I created a Windows Service project, the installers and the setup project for the service. Now I have the service installed but once I start it up, it's taking 100% CPU and not doing anything. I tried attaching the visual studio debugger to the win service process but it's not stopping at any breakpoints. Does anyone have any idea about why it's taking the 100% CPU. And how can I debug and see what's going on? Thanks very much in advance!! Agnes Tag: 'System.InvalidOperationException' Tag: 120759
      • 12
        • when my C# service impersonates a secondary account does the secondary account need any special permissions? what are they? when my C# service impersonates a secondary account does the secondary account need any special permissions? what are they? Tag: 'System.InvalidOperationException' Tag: 120756
      • 13
        • saving common settings without non-administrative privileges I am trying to find a way to save common data in my program that will not change from different users. I tried both HKEY_LOCAL_MACHINE and writting to an ini file and storing it in my Program directory. However, in order for this to work, all the users need administrative privileges. Is there a proper way to store common data that I am not aware of? For example, I have a test number that I need to increment. And this test number must not change when the user changes. Thanks Tag: 'System.InvalidOperationException' Tag: 120755
      • 14
        • CrystalReportViewer - Missing Group Headers in Preview I have a VS2005 C# windows application that uses the CrytalReportViewer (Crystal Reports XI Release 2 w/SP1) to view a report. I have two development systems; System1: Windows XP Pro x64 (desktop) System2: Windows XP Pro (laptop) When I run the app on System 1, the group headers and any lines are not visible when previewd on the screen. When exported to pdf or printed, all headers and lines are printed as expected. When I run the app on System 2, the preview is shown as expected. Any one run into this issue, and even better, have an idea of how to resolve it? thanks -- dchman Tag: 'System.InvalidOperationException' Tag: 120754
      • 15
        • HttpCFG DS Mapping not working I'm trying to configure DS Mapping with httpcfg. I have a test application using HttpListener which is listening on port 8001 ssl. To configure the ssl certificates I used httpcfg. This is my command: httpcfg set ssl -i 0.0.0.0:8001 -f 3 -c "MY" -h <Certificatehash> -f 3 : Should take care of mutual authentication and with DS Mapping. But it is not working. I know for sure the certificates are fine, and my AD mapping is ok, because if I test with IIS, it works perfect, and authenticates the client with the Windows user. But as soon as I move to my application and httpcfg, it validates the certificates, but it does not authenticate the client with a windows user. I'm using Thread.CurrentPrincipal.Identity.IsAuthenticated to see if it is working. http query ssl shows this: ------------------------------------------------------------------------ IP : 0.0.0.0:8001 Hash : 669b8ab4172fd790d8d5c9aca643f8fbd7 332b1 Guid : {00000000-0000-0000-0000-000000000000} CertStoreName : MY CertCheckMode : 0 RevocationFreshnessTime : 0 UrlRetrievalTimeout : 0 SslCtlIdentifier : (null) SslCtlStoreName : (null) Flags : 3 Can anyone help me?? Tks -- Oliver Quixchan Developer Tag: 'System.InvalidOperationException' Tag: 120745
      • 16
        • XmlSerializer usage 1) I have an XSD that defines a document structure 2) I have a business object whose internal state can be represented by an XML document that is conformant to the XSD specification Many times, the first thought a lot of folks have is, "Silly, just run your XSD through xsd.exe and you can get a dataset or a class model!" That's not going to work for me, though. My business object contains a good bit of logic and the lightweight zero-method classes that are generated by xsd.exe are not appropriate for what I'm doing. So, I decided to take the approach of implementing the IXmlSerializable interface instead. Life is good. I'm curious, though, how folks insulate their business object from changes in the schema? This object's state is being persisted as an XML string. There will come a time when I have to change the XSD to encance the feature set. So, my class will have to be able to Deserialize its state from either of 2 (or more) different XSD Schemas because there may be older persisted versions (and yes, I want to validate the XML). How do people generally handle this scenario? (no...just not validating the XML is not an option) Here's my approach: If the Class is called Person, then The Class Person Implements the IXmlSerializable interface The Person class has a number of private nested classes (so they have access to the Person class's state fields). These are called DeSerializationFactory Version1Deserializer Version2Deserializer Version3Deserializer ... VersionNDeserializer Serializer When ReadXml is called on the Person Class, the NamespaceURI property is checked. Based on the value of that property a Version[1 2 or 3]Deserializer is created via the DeSerializationFactory. The resultant serializer deserializes the state and then life is good. When WriteXml is called, the default Serializer instance is created and the state is written as XML (always the latest version). This seems to be working for me, but I was curious how other folks mitigate this. Tag: 'System.InvalidOperationException' Tag: 120742
      • 17
        • javascript to datagrid itemtemplate textbox hi, How do i pass a javascript value to datagrid itemtemplate textbox using javascript. Kalaivanan Tag: 'System.InvalidOperationException' Tag: 120738
      • 18
        • Command Line Compailation Hi, My Vb.net solution file contain 3 projects. There are Client ,Business Logic, Data Access. I want to compail my total solution from command line. Can any one help me for this. -- Regards, R.Sathiamoorthy Tag: 'System.InvalidOperationException' Tag: 120735
      • 19
        • Setup and deploy project in Visual Studio 2005 Is there any way to have versionnumber autoincrement of a setup and deploy-project? Tag: 'System.InvalidOperationException' Tag: 120730
      • 20
        • Component One TrueDB Fetch row style I knew how to do it in VB6 but I can't figure it out in VB.NET In vb6 I did this Private sub TGDB_FetchRowStyle(...) dim RStemp as recordset RStemp = RSMaster.clone RStemp.bookmark = RSmaster.bookmark if rstemp!somefiled = "something" then TGDB.rowstyle=something SET RStemp=nothing End Sub And i don't know what to do in VN.NET I use DataTable to fill the grid TGDB.SetDataBinding (DataTableName, Nothing, True) I can't find a example... Thanks -- You're not paid to think. A mindless worker is a happy worker. Shut up and do your job! - Tata Feudalac! -------------------------------------------------------- http://www.fotozine.org/index.php?stranica=clan&uid=1352 http://www.thinkgeek.com/brain/gimme.cgi?wid=81d35dc8f http://groups.google.com/group/fejkneraddangub -------------------------------------------------------- Tag: 'System.InvalidOperationException' Tag: 120723
      • 21
        • How To: Setup project Custom dialog boxes Hi In my setup project I need a custom dialog box containing a drop down list box. Since this is not avaialble from standard user interface dialog boxes that visual studio supplies, I am using Installer class. This installer class inturn displays the custom dialog box i need. but the problem is this custom dialog box is displayed as a popup window during installation. But I want this custom dialog box to be shown as one of the wizard pages during installation. Has any one done this before? I know some few setup programs that do this. However I am not sure that they used visual studio setup and deployment project to create their setup programs. Thanks Gancy Tag: 'System.InvalidOperationException' Tag: 120721
      • 22
        • Drawstring inserts spurious linebreak after character #132 I am using DotNet v1.1.4322. This issue can be replicated with various text fonts - but is easiest to see using WingDings. 1) Create a string which includes character #132 2) Draw it to a Graphics object with DrawString S := #130+#131+#132+#133+#134+#135+#136+#137+#138+#139; F := System.Drawing.Font.Create('WingDings', 16); G.DrawString(S, F, Brushes.Black, 0, 0); The output always wraps immediately after character #132, regardless of font size, StringFormat settings, etc. Is this a bug in DrawString, or is it due to some other setting of which I am not aware? Does it happen in DotNet v2? Tag: 'System.InvalidOperationException' Tag: 120720
      • 23
        • ControlToValidate = Page? Is there a way to make a custom validator that will act as a client side (run time) validator for the entire page (.aspx)? I would like to show a short validation message without having to postback to check if the page.Isvalid = true. Tag: 'System.InvalidOperationException' Tag: 120712
      • 24
        • .Net x64 / x32 incompatibility "is ambiguous in the namespace" I ma trying to compile my XP x32 build after reboot into XPx64 as native x64 application. In VS2005 I changed my VB.net configuration to x64 and changed the reference path to point to c:\windows\microsoft.net\framework64 (before it was without the 64). Most things fell into place after these changes, but several classes are no longer available in the interllisense completion list and they are listed as errors as well. Even simple things such as Debug.Assert() are no longer available. Sample error: 'Debug' is ambiguous in the namespace 'System.Dosagnostics'. Do those classses really not exist as 64 bit version? What is the best way to resolve this? Thanks, Ingmar Tag: 'System.InvalidOperationException' Tag: 120710
      • 25
        • Seemingly simple regex question I'm using the following regex expression where "searchword" is a string: string regrexstr = @"( |^)\b" + searchword + @"+( |\b)" My goal is to use this string to ultimately replace all occurances of searchword as long as: a) it has a preceeding space or it's the beginning of a line AND b) it is suffixed with a space or a newline character The problem right now is that using the above string and calling Regex.Replace also replaces the leading/trailing spaces. I want the spaces to count during the match, but be ignored during the replace. Is that easily do-able? I'm probably going about this the wrong way. In short, I want to do a word replacement throughout a large file. TIA! -sb Tag: 'System.InvalidOperationException' Tag: 120706
    • Next
      • 1
        • Wanted: .NET Infrastructure book Hi folks, I work in IT, but on the infrastructure/engineering side. At work I'm now being asked to design infrastructure solutions to support new .NET applications. Typically, this infrastructure must be highly available and support things like load balancing etc.... the only problem is I don't have a thorough understanding of how to accomplish this. Is the infrastructure tiered? How does the presentation layer talk to the middleware? These are the types of questions I have. I want to get a grounding how infrastructure wraps around the .NET framework and how enterprise solutions are designed. Can anyone point me in the right direction? eg... a good book or the like. cheers, froowstie Tag: 'System.InvalidOperationException' Tag: 120705
      • 2
        • Error with SqlSmlCommand I am attempting to read XML data directly from a table in SQL Server 2000 using VB.Net 2003. When I run the code shown below, I get the following error: "SQLXML: invalid direct object (dbobject) query -><-" I applied SqlXml 3.0 Service Pack 3 to both client and server. My project references Microsoft.Data.SqlXml. Client is Windows XP Pro, Server is Windows Server 2003 with SQL Server 2000. All service packs and patches are current. '---------------------------------------------------------------------------- Imports Microsoft.Data.SqlXml Private Sub ReadXML() Dim CS As String = "Provider=SQLOLEDB; Data Source=MyServer; Initial Catalog=MyDB; User Id=MyUser; Password=MyPassword" Try Dim cmd As New SqlXmlCommand(CS) cmd.CommandType = CommandType.Text cmd.CommandText = "Select parent_ID from tblData _ FOR XML AUTO, ELEMENTS" Dim xr As XmlReader xr = cmd.ExecuteXmlReader '<------Error happens here xr.Close() Catch ex As Exception MessageBox.Show(ex.Message) Finally End Try End Sub Can anyone figure out what I'm missing? Specifying column names in the SQL also has no effect. I tried adding a root tag to the command using the code below before executing the reader but it had no effect. cmd.RootTag = "xmlns:sql=""urn:schemas-microsoft-com:xml-sql""" Thanks, John Tag: 'System.InvalidOperationException' Tag: 120701
      • 3
        • PublicKey of System.Xml assembly I need to make some classes in my assembly internal. I am using XMLSerializer to serialize the objects of my classes. XMLSerializer cannot access my internal classes. So I am thinking that adding System.Xml as a friend would make my internal classes visible to XMLSerializer. Adding System.Xml as a friend requires public key of the System.Xml assembly specified. I can get the PublicKeyToken, but not the public key. I tried following code also but no luck, it just returns 16 bytes (0000000040000000). Assembly assembly = Assembly.GetAssembly( typeof(System.Xml.Serialization.XmlSerializer)); byte[] pubkey = assembly.GetName().GetPublicKey(); Any ideas to get the public key of System.Xml assembly, it doesn't have to be programatically. Thanks! Tag: 'System.InvalidOperationException' Tag: 120700
      • 4
        • WSS document event handler that will use System.web.mail sendmail I am not using vs studio 2.0 I have 1.1 I have a WSS document event handler that works on a document insert, I want to use system.web.mail to get to sendmail and put out an email. Document event handlers are written with C# class library which does not allow me to reference system.web.mail. I use use the interface with a web control and reference the web control from within the document event class but when I compile I get c:\Documents and Settings\cmello\My Documents\Visual Studio Projects\SISWorkflow\bin\Debug\SendMailCtrl.dll Referenced class 'SendMailCtrl.DocLibSendMail' has base class or interface 'System.Web.UI.WebControls.WebControl' defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web'. I am thinking that is because in the SendMailCtrl dll there is a method that uses SendMail and the reference to System.web.mail inside the web control project is the reason that I cannot create a new instance of the web control object in my C# document event library and call the method to send mail. Help!! please I need to have a document library insert event send my custom email to users who have alerts set without having to go into CAML and rewrite the alert notification AARGH -- cindy Tag: 'System.InvalidOperationException' Tag: 120695
      • 5
        • StatusStrip layout Greetings, We are using StatusStrip to present various status messages, progress bars, and so forth, throughout the user experience. We are finding, however, that the layout leaves something to be desired, or we do not have a good understanding of how layout is managed. In particular, how does one designate specified regions for one text or another or a progress bar? For example, without things hiding and moving around? Is there a way to do this, something like what taskbar does for us, or what one might find in Microsoft Word or Excel? Thanks in advance. Best regards, Michael Tag: 'System.InvalidOperationException' Tag: 120691
      • 6
        • Setting StringBuilder.Length not behaving per documentation Perhaps this has been discussed elsewhere - if so, I couldn't find it. The StringBuilder.Length property is explicitly documented as padding the length with spaces if .Length is set to a value greater than the current length. I'm hoping to get this behavior. However, when I set .Length to something greater than the current length, the padding is done with null characters ('\0'), not spaces. Is this the actual intended behavior (and the docs are wrong) or a bug (and the docs are right)? Any help in this would be appreciated. Thanks, Donnie Tag: 'System.InvalidOperationException' Tag: 120686
      • 7
        • Serialization Files Compatibility I pciked up a project and am encountering several deficiencies on the architecture. My current concerns are the persisted data files that are written and read through dynamic reflection and Serialization/De-Serialization. The application has been going on for a while and is using .Net Framework 1.1. They intend to switch to .Net Framework 2.0. If data files are saved through an application saved on .Net 1.1 and later attempted to read through an application running on the .Net 2.0 Framework, will it work? Also, this is a number crunching application. There will be versions running on 32-bit machines and 64-bit machines. Can Serialized data files be shared between versions of the application running on the 2 platforms? -- Ed Reyes Tag: 'System.InvalidOperationException' Tag: 120685
      • 8
        • ClickOnce - Setting up a staging and production versions I want to be able to install a staging version and production version on my desktop of a ClickOnce application. I have created two separate virtual directories on a web server. I changed the product name in the Publish - Options dialog. When I install from the staging location, it overwrites my production version that was installed from the production virtual directory. Is there a product guid that is maintained? Any way to accomplish this? Tag: 'System.InvalidOperationException' Tag: 120680
      • 9
        • modify the keyboard queue Hi I need to be able to modify the keyboard queue and I have no idea how to do it. I have a windows app (C#) that should login to another application when pressing a login button. I have no access to the other application so I would like to add the username and password to the keyboard queu and login to the third part application that way. Is this possible to do? Does anyone knows where to find some information about this area? Thanks a lot Julia Tag: 'System.InvalidOperationException' Tag: 120679
      • 10
        • creating a compile time error... is it possible? Hi, I'd like to create a compile time error in my class... maybe there's a way already built in in the framework so I can achieve what I want... I have 2 constructors in my class. One of them has mandatory parameters, I mean, they should not be null nor empty (for strings). So I'd make the validation in the constructor and generate a compile-time error if the validation does not match... Is there a way to achieve this or to specify mandatory parameters? (I'm using C#) thanks ThunderMusic Tag: 'System.InvalidOperationException' Tag: 120677
      • 11
        • http://www.ringtones-dir.com/get/ ringtones site. http://www.ringtones-dir.com/get/ ringtones site. Download ringtones FREE, Best free samsung ringtones, Cingular ringtones and more. From website . Tag: 'System.InvalidOperationException' Tag: 120676
      • 12
        • http://www.ringtones-dir.com/get/ ringtones site. http://www.ringtones-dir.com/get/ ringtones site. [URL=http://www.ringtones-dir.com]ringtones download[/URL]: Download ringtones FREE, Best free samsung ringtones, Cingular ringtones and more. [url=http://www.ringtones-dir.com]samsung ringtones[/url] From website . Tag: 'System.InvalidOperationException' Tag: 120675
      • 13
        • Querying Active Directory Hi Can anyone tell me, how can I search for Domain Administrators on a network. What I mean is by using DirectorySearcher I can search for normal users, which goes something like DirectorySearcher ds = new DirectorySearcher(new DirectoryEntry()); ds.Filter="objectCategory=User"; ds.FindAll(); Similarly how can I search for administrative accounts? Thanks in advance Vikas Tag: 'System.InvalidOperationException' Tag: 120666
      • 14
        • using SerialPort in a service Hello, Someone can tell me why I dont get serial port events in a Service, I created a separate Thread to open the port but no events are coming up (the same happens when I use the timer component, using the System.Timers.Timer it works fine) tnx in advance Jean Paul Tag: 'System.InvalidOperationException' Tag: 120665
      • 15
        • ActiveX controls not painted on a TabControl of a UserControl Hello, I'm trying to build an application using some ActiveX controls (Microsoft Web Browser and Windows Media Player). I first put a tab control on a form, with activex controls on tab pages. Everything went ok on the different tab pages. I came to a problem when i placed the tab control on a user control instead of placing it directly to the form, With the user control on the form, only the activex controls on the first tab page would display, activex controls on other tab pages are just not painted. Does someone know where the problem comes from ? Thanks for your help, Valerie Tag: 'System.InvalidOperationException' Tag: 120664
      • 16
        • startup times woes... Hi All! I try to understand and improve my application cold start. I already load as little as possible in the Main(). Now I have a test which gives strange results, and I try to understand what it means. test 1: ==== I reboot, launch a small .NET executable, which takes 7 seconds, and launch my application, which takes 30 seconds. test 2: ==== I reboot, launch my application, which takes 70 seconds. Now this doesn't add-up, why? Any idea what's going on? I'm thinking to write a small "QuickStart" application which "initialize" everything. How should it work? Tag: 'System.InvalidOperationException' Tag: 120659
      • 17
        • Sewin is a joke I am not that much job less to follow a suit like that and of course i ll teach them, but its not a matter of teaching its a matter of rules and morals and ya are right that its nothing unwanted and i didnt know that spamc created for targeting newsgroups especially msnews that most of the material is text and the content is thechnical Tag: 'System.InvalidOperationException' Tag: 120655
      • 18
        • one decimal point in text box Hi all, C# newbie after migrating from VB. I wish to have only valid numbers entered into a txtbox . i.e only one decimal point. ///////////////////My VB code for this is: Private Sub txtGcost_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57, 8 Case 46 If InStr(txtGcost.Text, ".") > 0 Then 'Decimal point already there. KeyAscii = 0 If Left(txtGcost.Text, 1) = "." Then txtGcost = "0." End If End If Case Else KeyAscii = 0 End Select End Sub ///////////////My C# code is: private void txtCost_KeyPress(object sender, KeyPressEventArgs e) { { const char Delete = (char)8; const char dot = (char)46; string check4dot = "."; string searchstring = txtCost.Text; int checkit = searchstring.IndexOf(check4dot); if (checkit >1 ) { e.Handled = !Char.IsDigit(e.KeyChar) && e.KeyChar != Delete && e.KeyChar != dot; Which works fine, except for not allowing no more than one decimal point, Thank in advance Tag: 'System.InvalidOperationException' Tag: 120654
      • 19
        • when serializing XML, how to NOT save type's fullname I have a strongnamed application. In that assembly, I also have a Settings class that's XmlSerializable. <xmlSerializerSection type="MyApp.MyAppSettings, MyApp"> <MyAppSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- some settings... --> </MyAppSettings > </xmlSerializerSection> Using June 2005 Enterprise Library's ConfigurationManager.WriteConfiguration, I save user changes to the settings. However, it serializes the settings with the fullname of the type: <xmlSerializerSection type="MyApp.MyAppSettings, MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1234567890ABCDEF"> <MyAppSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- some settings... --> </MyAppSettings > </xmlSerializerSection> This is problematic when I roll out updates to the application. When I roll out version 1.0.1.0 of the application, ConfigurationManager.GetConfiguration() fails because the user's xml settings refer back to 1.0.0.0. If the xmlSerializerSection's type contains only the type name and assembly, everything works great (i.e., it loads the type from 1.0.1.0). Binding redirect from 1.0.0.0 to 1.0.1.0 doesn't seem to work. I have the following options: 1. Don't make the application strongnamed. 2. Keeps the settings class in a seperate assembly. I'm not crazy about either options. When serializing xml, is it possible not to save the type's fullname? thanks in advance. JT Tag: 'System.InvalidOperationException' Tag: 120653
      • 20
        • Block-level CD-ROM access Hello all, Is there a method within the .NET Framework to access a CD-ROM device at the block-level? (IE to create a raw copy of a disc for archival purposes) Thanks, - Scott Tag: 'System.InvalidOperationException' Tag: 120651
      • 21
        • custom paging using oracle procedure in .net C# Hi, I am developing a oracle procedure for using custom paging in one of the project where in we are getting thousands of records into cache. To avoid this, i am creating orcale procedure to use custom paging for data grid. Can any one please provide some inputs, if you have done something like this. Regards, netdev Tag: 'System.InvalidOperationException' Tag: 120649
      • 22
        • probem with WPF ListBox.... This is a multi-part message in MIME format. ------=_NextPart_000_001D_01C6C480.607AB3F0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_001E_01C6C480.607AB3F0" ------=_NextPart_001_001E_01C6C480.607AB3F0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable =20 I have built an WPF application that gets links to photos from a web = service (flickr) and used the following code to achieve it: <Button HorizontalAlignment=3D"Stretch" VerticalAlignment=3D"Stretch" = Margin=3D"31,10,39.0000000000001,17" Width=3D"Auto" Height=3D"Auto" = x:Name=3D"Button" Content=3D"Get Photos" = RenderTransformOrigin=3D"-0.462962962962963,-0.40625" = Grid.ColumnSpan=3D"1" Grid.RowSpan=3D"1" Command=3D"{Binding = GetDataCommand, Mode=3DDefault, Source=3D{StaticResource = PhotosCollectionDS}}"> <Button.RenderTransform> <TransformGroup> <TranslateTransform X=3D"0" Y=3D"0"/> <ScaleTransform ScaleX=3D"1" ScaleY=3D"1"/> <SkewTransform AngleX=3D"0" AngleY=3D"0"/> <RotateTransform Angle=3D"0"/> <TranslateTransform X=3D"0" Y=3D"0"/> <TranslateTransform X=3D"0" Y=3D"0"/> </TransformGroup> </Button.RenderTransform> </Button> <ListBox HorizontalAlignment=3D"Stretch" Margin=3D"12,21,12,10" = Width=3D"Auto" x:Name=3D"ListBox" Grid.Row=3D"1" Grid.ColumnSpan=3D"1" = ItemsSource=3D"{Binding Photos, Mode=3DDefault, Source=3D{StaticResource = PhotosCollectionDS}}" ItemTemplate=3D"{DynamicResource = PhotosTemplate}"/> Then I have tried to modify this using Visual Studio so that the Click = event is handled in the codebehind file <Button.... = Click=3D"OnButtonClick">.....</Button> have tried calling refresh() on the listbox items but this didn't = work...=20 If I use the code in the previous post, everything works fine.... If I use the following code, the thing does not work.... <Grid=20 xmlns=3D"http://schemas.microsoft.com/winfx/2006/xaml/presentation"=20 xmlns:x=3D"http://schemas.microsoft.com/winfx/2006/xaml"=20 xmlns:mc=3D"http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d=3D"http://schemas.microsoft.com/expression/interactivedesigner/20= 06" mc:Ignorable=3D"d" Background=3D"#FFFFFFFF"=20 x:Name=3D"DocumentRoot" x:Class=3D"UntitledProject1.Scene1"=20 Width=3D"640" Height=3D"480" = xmlns:FlickrAPI=3D"clr-namespace:FlickrAPI;assembly=3DFlickrActivityLibra= ry"> <Grid.Resources> <Storyboard x:Key=3D"OnLoaded"/> <ObjectDataProvider x:Key=3D"PhotosCollectionDS" d:IsDataSource=3D"True" = ObjectType=3D"{x:Type FlickrAPI:PhotosCollection}"/> <DataTemplate x:Key=3D"PhotosTemplate"> <StackPanel x:Name=3D"StackPanel"> <Image x:Name=3D"Image" Source=3D"{Binding ThumbNailPhoto}"/> </StackPanel> </DataTemplate> </Grid.Resources> <Grid.Triggers> <EventTrigger RoutedEvent=3D"FrameworkElement.Loaded"> <BeginStoryboard x:Name=3D"OnLoaded_BeginStoryboard" = Storyboard=3D"{DynamicResource OnLoaded}"/> </EventTrigger> </Grid.Triggers> <Grid.ColumnDefinitions> <ColumnDefinition Width=3D"0.3046875*"/> <ColumnDefinition Width=3D"0.6953125*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height=3D"0.13125*"/> <RowDefinition Height=3D"0.86875*"/> </Grid.RowDefinitions> <Button HorizontalAlignment=3D"Stretch" VerticalAlignment=3D"Stretch" = Margin=3D"31,10,39.0000000000001,17" Width=3D"Auto" Height=3D"Auto" = x:Name=3D"Button" Content=3D"Get Photos" = RenderTransformOrigin=3D"-0.462962962962963,-0.40625" = Grid.ColumnSpan=3D"1" Grid.RowSpan=3D"1" Click=3D"OnButtonClick"> <Button.RenderTransform> <TransformGroup> <TranslateTransform X=3D"0" Y=3D"0"/> <ScaleTransform ScaleX=3D"1" ScaleY=3D"1"/> <SkewTransform AngleX=3D"0" AngleY=3D"0"/> <RotateTransform Angle=3D"0"/> <TranslateTransform X=3D"0" Y=3D"0"/> <TranslateTransform X=3D"0" Y=3D"0"/> </TransformGroup> </Button.RenderTransform> </Button> <ListBox HorizontalAlignment=3D"Stretch" Margin=3D"12,21,12,10" = Width=3D"Auto" x:Name=3D"ListBox" Grid.Row=3D"1" Grid.ColumnSpan=3D"1" = ItemsSource=3D"{Binding Photos, Mode=3DDefault, Source=3D{StaticResource = PhotosCollectionDS}}" ItemTemplate=3D"{DynamicResource = PhotosTemplate}"/> </Grid> The problematic part is in Black and bolded. Now the OnButtonClick is = defined as follows: public void OnButtonClick(object sender, EventArgs e) { InitializeWorkflow(); instance.Start(); string tempString =3D ""; waitHandle.WaitOne(); for (int i =3D 0; i < ds1.Tables.Count; i++) { for (int j =3D 0; j < ds1.Tables.Rows.Count; j++) { tempString =3D tempString + "Table: {" + ds1.Tables.TableName + "}, Row: = {" + j + "}:" + "\n"; for (int k =3D 0; k < ds1.Tables.Columns.Count; k++) { tempString =3D tempString + "Table: {" + ds1.Tables.TableName + "}, = Column: {" + ds1.Tables.Columns[k].ColumnName + "}, Value: {" + = ds1.Tables.Rows[j][k] + "}" + "\t"; } //Console.WriteLine("Table: {0}, Column: {1}, Value: {2}", = ds.Tables.TableName, ds.Tables.Columns[j].ColumnName, ds.Tables.); } } System.Windows.MessageBox.Show(tempString); FlickrAPI.PhotosCollection pc =3D new FlickrAPI.PhotosCollection(); pc.ds =3D ds1; pc.GetData(); //This should populate the listBox } And the part where GetDataCommand is defined is: public class PhotosCollection { public DataSet ds=3D new DataSet(); private static DataTable photoDataTable=3D new DataTable(); private ObservableCollection<Photo> photos =3D new = ObservableCollection<Photo>(); public ObservableCollection<Photo> Photos { get { return this.photos; } = } private DelegateCommand getDataCommand; public PhotosCollection() { getDataCommand =3D new DelegateCommand(delegate() { GetData(); }); } public DelegateCommand GetDataCommand { get { return getDataCommand; } } public void GetData() { string apiSig =3D = FlickrAPI.HelperMathods.Md5Sum("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"= ); FlickrAPI.Response res =3D new FlickrAPI.Response(); string tempString =3D ""; tempString =3D = res.GetResponse("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); StringReader sreader =3D new StringReader(tempString); ds.ReadXml(sreader); photoDataTable=3Dds.Tables["photo"]; photos.Clear(); for (int i =3D 0; i < photoDataTable.Rows.Count; i++) { photos.Add(new Photo((string)photoDataTable.Rows[0], = (string)photoDataTable.Rows[1], (string)photoDataTable.Rows[2], = (string)photoDataTable.Rows[3], (string)photoDataTable.Rows[4], = (string)photoDataTable.Rows[5], (string)photoDataTable.Rows, = (string)photoDataTable.Rows[7])); } } } public class Photo { private string id; private string owner; private string secret; private string server; private string title; private string ispublic; private string isfriend; private string isfamily; private String photoURL; public Photo(string id, string owner, string secret, string server, = string title, string ispublic, string isfriend, string isfamily) { this.id =3D id; this.owner =3D owner; this.secret =3D secret; this.server=3Dserver; this.title =3D title; this.ispublic =3D ispublic; this.isfriend =3D isfriend; this.isfamily =3D isfamily; photoURL=3D("http://static.flickr.com/"+this.server+"/"+this.id+"_"+this.= secret+"_t.jpg"); this.thumbNailPhoto =3D ImageFromString(photoURL); } public ImageSource ThumbNailPhoto { get { return this.thumbNailPhoto; } } ImageSource thumbNailPhoto; public ImageSource ImageFromString(string url) { BitmapImage image =3D null; if (url !=3D null) { image =3D new BitmapImage(); image.BeginInit(); image.UriSource =3D new Uri(url); image.EndInit(); } return image; } } I am pretty sure that it is a very st*** mistake.. But I cannot figure = out what is the mistake.... Any help is really appreciated. Thanks, M.V. ------=_NextPart_001_001E_01C6C480.607AB3F0 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dwindows-1250"> <STYLE></STYLE> <META content=3D"MSHTML 6.00.5450.4" name=3DGENERATOR></HEAD> <BODY id=3DMailContainerBody=20 style=3D"PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"=20 bgColor=3D#ffffff leftMargin=3D0 topMargin=3D0 CanvasTabStop=3D"true" = acc_role=3D"text"=20 name=3D"Compose message area"><SPAN><FONT face=3DCalibri = size=3D2>&nbsp;</FONT>=20 <P><FONT face=3DCalibri size=3D2>I have built an WPF application that = gets links to=20 photos from a web service (flickr) and used the following code to = achieve=20 it:</FONT></P><FONT color=3D#0000ff> <P><FONT face=3DCalibri size=3D2>&lt;</FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#800000>Button</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>HorizontalAlignment</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Stretch</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>VerticalAlignment</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Stretch</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Margin</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>31,10,39.0000000000001,17</FONT>"<FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>Width</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Auto</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Height</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Auto</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Button</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Content</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>Get=20 Photos</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>RenderTransformOrigin</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>-0.462962962962963,-0.40625</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Grid.ColumnSpan</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>1</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Grid.RowSpan</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Command</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>{Binding GetDataCommand, Mode=3DDefault, = Source=3D{StaticResource=20 PhotosCollectionDS}}</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>Button.RenderTransform</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TransformGroup</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TranslateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>X</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Y</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT = color=3D#800000>ScaleTransform</FONT><FONT=20 color=3D#0000ff> </FONT><FONT color=3D#ff0000>ScaleX</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>1</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>ScaleY</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT = color=3D#800000>SkewTransform</FONT><FONT=20 color=3D#0000ff> </FONT><FONT color=3D#ff0000>AngleX</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>0</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>AngleY</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>RotateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>Angle</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TranslateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>X</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Y</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TranslateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>X</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Y</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>TransformGroup</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Button.RenderTransform</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Button</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT = color=3D#800000>ListBox</FONT><FONT=20 color=3D#0000ff> </FONT><FONT = color=3D#ff0000>HorizontalAlignment</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>Stretch</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Margin</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>12,21,12,10</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Width</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Auto</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>ListBox</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Grid.Row</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Grid.ColumnSpan</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>ItemsSource</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>{Binding Photos, Mode=3DDefault, = Source=3D{StaticResource=20 PhotosCollectionDS}}</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>ItemTemplate</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>{DynamicResource PhotosTemplate}</FONT>"<FONT=20 color=3D#0000ff>/&gt;</FONT></FONT></FONT></P> <P><FONT face=3DCalibri color=3D#000000 size=3D2>Then I have tried to = modify this=20 using Visual Studio so that the Click event is handled in the codebehind = file=20 &lt;Button.... = Click=3D"OnButtonClick"&gt;.....&lt;/Button&gt;</FONT></P></SPAN> <DIV><FONT face=3DCalibri size=3D2>have tried calling refresh() on the = listbox items=20 but this didn't work...</FONT>=20 <P><FONT face=3DCalibri size=3D2>If I use the code in the previous post, = everything=20 works fine....</FONT></P> <P><FONT face=3DCalibri size=3D2>If I use the following code, the thing = does not=20 work....</FONT></P><FONT color=3D#0000ff> <P><FONT face=3DCalibri size=3D2>&lt;</FONT></FONT><FONT face=3DCalibri = color=3D#800000=20 size=3D2>Grid</FONT><FONT face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>=20 <BR></FONT><FONT color=3D#ff0000>xmlns</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>http://schemas.microsoft.com/winfx/2006/xaml/presentation= </FONT>"</FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT color=3D#0000ff> <BR></FONT><FONT=20 color=3D#ff0000>xmlns:x</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>http://schemas.microsoft.com/winfx/2006/xaml</FONT>"</FON= T></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT color=3D#0000ff> <BR></FONT><FONT=20 color=3D#ff0000>xmlns:mc</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>http://schemas.openxmlformats.org/markup-compatibility/20= 06</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>"<BR><FONT = color=3D#ff0000>xmlns:d</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>http://schemas.microsoft.com/expression/interactivedesign= er/2006</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>"<BR><FONT = color=3D#ff0000>mc:Ignorable</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>d</FONT></FONT></FONT><FONT=20 face=3DCalibri size=3D2>"<BR><FONT = color=3D#ff0000>Background</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>#FFFFFFFF</FONT>"</FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT color=3D#0000ff> <BR></FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>DocumentRoot</FONT></FONT></FONT><FONT face=3DCalibri=20 size=3D2>"<BR><FONT color=3D#ff0000>x:Class</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>UntitledProject1.Scene1</FONT>"</FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff> <BR></FONT><FONT = color=3D#ff0000>Width</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>640</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Height</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>480</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>xmlns:FlickrAPI</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>clr-namespace:FlickrAPI;assembly=3DFlickrActivityLibrary<= /FONT>"</FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>Grid.Resources</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>Storyboard</FONT><FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Key</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>OnLoaded</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>ObjectDataProvider</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>x:Key</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>PhotosCollectionDS</FONT>"<FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>d:IsDataSource</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>True</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>ObjectType</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>{x:Type = FlickrAPI:PhotosCollection}</FONT>"</FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>DataTemplate</FONT><FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Key</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>PhotosTemplate</FONT>"</FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>StackPanel</FONT><FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>StackPanel</FONT>"</FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>Image</FONT><FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Image</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Source</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>{Binding ThumbNailPhoto}</FONT>"</FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>/&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>StackPanel</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>DataTemplate</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Grid.Resources</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>Grid.Triggers</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>EventTrigger</FONT><FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>RoutedEvent</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>FrameworkElement.Loaded</FONT>"</FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>BeginStoryboard</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>OnLoaded_BeginStoryboard</FONT>"<FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>Storyboard</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>{DynamicResource OnLoaded}</FONT>"</FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>/&gt;<BR></FONT><FONT=20 color=3D#0000ff>&lt;/</FONT><FONT=20 color=3D#800000>EventTrigger</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Grid.Triggers</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>Grid.ColumnDefinitions</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>ColumnDefinition</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>Width</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0.3046875*</FONT>"</FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>ColumnDefinition</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>Width</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0.6953125*</FONT>"</FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>/&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Grid.ColumnDefinitions</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>Grid.RowDefinitions</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>RowDefinition</FONT><FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Height</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0.13125*</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>RowDefinition</FONT><FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Height</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0.86875*</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT color=3D#0000ff>/&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Grid.RowDefinitions</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>Button</FONT><FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>HorizontalAlignment</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Stretch</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>VerticalAlignment</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Stretch</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Margin</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>31,10,39.0000000000001,17</FONT>"<FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>Width</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Auto</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Height</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Auto</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Button</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Content</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>Get=20 Photos</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>RenderTransformOrigin</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>-0.462962962962963,-0.40625</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Grid.ColumnSpan</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>1</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Grid.RowSpan</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"<FONT color=3D#0000ff> <FONT=20 color=3D#333333><STRONG>Click=3D"OnButtonClick</STRONG>"</FONT></FONT></F= ONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT color=3D#0000ff><FONT=20 color=3D#333399>&gt;</FONT><BR>&lt;</FONT><FONT=20 color=3D#800000>Button.RenderTransform</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TransformGroup</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TranslateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>X</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Y</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT = color=3D#800000>ScaleTransform</FONT><FONT=20 color=3D#0000ff> </FONT><FONT color=3D#ff0000>ScaleX</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>1</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>ScaleY</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT = color=3D#800000>SkewTransform</FONT><FONT=20 color=3D#0000ff> </FONT><FONT color=3D#ff0000>AngleX</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>0</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>AngleY</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>RotateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>Angle</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TranslateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>X</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Y</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TranslateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>X</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Y</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>TransformGroup</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Button.RenderTransform</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Button</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT = color=3D#800000>ListBox</FONT><FONT=20 color=3D#0000ff> </FONT><FONT = color=3D#ff0000>HorizontalAlignment</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>Stretch</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Margin</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>12,21,12,10</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Width</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Auto</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>ListBox</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Grid.Row</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Grid.ColumnSpan</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>ItemsSource</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>{Binding Photos, Mode=3DDefault, = Source=3D{StaticResource=20 PhotosCollectionDS}}</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>ItemTemplate</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>{DynamicResource = PhotosTemplate}</FONT>"</FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>/&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Grid</FONT><FONT = color=3D#0000ff>&gt;</FONT></FONT></FONT></P> <P><FONT color=3D#0000ff><FONT face=3DCalibri color=3D#000000 = size=3D2>The problematic=20 part is in Black and bolded. Now the OnButtonClick is defined as=20 follows:</FONT></FONT></P><FONT color=3D#0000ff><FONT color=3D#0000ff> <P><FONT face=3DCalibri size=3D2>public</FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#000000> </FONT><FONT = color=3D#0000ff>void</FONT><FONT=20 color=3D#000000> OnButtonClick(</FONT><FONT = color=3D#0000ff>object</FONT><FONT=20 color=3D#000000> sender, </FONT><FONT=20 color=3D#008080>EventArgs</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT color=3D#000000>=20 e)<BR></FONT>{<BR>InitializeWorkflow();<BR>instance.Start();<BR><FONT=20 color=3D#0000ff>string</FONT> tempString =3D <FONT=20 color=3D#800000>""</FONT></FONT></FONT><FONT face=3DCalibri><FONT=20 size=3D2>;<BR>waitHandle.WaitOne();<BR><FONT color=3D#0000ff>for</FONT> = (<FONT=20 color=3D#0000ff>int</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2> i =3D 0; i=20 &lt; ds1.Tables.Count; i++)<BR>{<BR><FONT color=3D#0000ff>for</FONT> = (<FONT=20 color=3D#0000ff>int</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2> j =3D 0; j=20 &lt; ds1.Tables<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">.Rows.Count;=20 j++)<BR>{<BR>tempString =3D tempString + <FONT color=3D#800000>"Table: = {"</FONT> +=20 ds1.Tables<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">.TableName=20 + <FONT color=3D#800000>"}, Row: {"</FONT> + j + <FONT = color=3D#800000>"}:"</FONT> +=20 <FONT color=3D#800000>"\n"</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2>;<BR><FONT color=3D#0000ff>for</FONT> (<FONT=20 color=3D#0000ff>int</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2> k =3D 0; k=20 &lt; ds1.Tables<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">.Columns.Count= ;=20 k++)<BR>{<BR>tempString =3D tempString + <FONT color=3D#800000>"Table: = {"</FONT> +=20 ds1.Tables<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">.TableName=20 + <FONT color=3D#800000>"}, Column: {"</FONT> + ds1.Tables<IMG = alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">.Columns[k].Co= lumnName=20 + <FONT color=3D#800000>"}, Value: {"</FONT> + ds1.Tables<IMG alt=3DIdea = src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">.Rows[j][k]=20 + <FONT color=3D#800000>"}"</FONT> + <FONT=20 color=3D#800000>"\t"</FONT></FONT></FONT><FONT face=3DCalibri=20 size=3D2>;<BR>}<BR></FONT><FONT face=3DCalibri color=3D#008000=20 size=3D2>//Console.WriteLine("Table: {0}, Column: {1}, Value: {2}", = ds.Tables<IMG=20 alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">.TableName,=20 ds.Tables<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">.Columns[j].Co= lumnName,=20 ds.Tables<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">.);<BR></FONT>= <FONT=20 face=3DCalibri><FONT size=3D2>}<BR>}<BR>System.Windows.<FONT=20 color=3D#008080>MessageBox</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2>.Show(tempString);<BR>FlickrAPI.<FONT=20 color=3D#008080>PhotosCollection</FONT> pc =3D <FONT = color=3D#0000ff>new</FONT>=20 FlickrAPI.<FONT = color=3D#008080>PhotosCollection</FONT></FONT></FONT><FONT=20 face=3DCalibri size=3D2>();<BR>pc.ds =3D ds1;<BR>pc.GetData(); <FONT=20 color=3D#000000>//This should populate the = listBox</FONT><BR>}</FONT></P></FONT> <P><FONT face=3DCalibri size=3D2>And the part where GetDataCommand is = defined=20 is:</FONT></P> <P><FONT face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>public</FONT> <FONT=20 color=3D#0000ff>class</FONT> </FONT></FONT><FONT face=3DCalibri = color=3D#008080=20 size=3D2>PhotosCollection<BR></FONT><FONT face=3DCalibri><FONT = size=3D2>{<BR><FONT=20 color=3D#0000ff>public</FONT> <FONT color=3D#008080>DataSet</FONT> ds=3D = <FONT=20 color=3D#0000ff>new</FONT> <FONT = color=3D#008080>DataSet</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>();<BR><FONT = color=3D#0000ff>private</FONT> <FONT=20 color=3D#0000ff>static</FONT> <FONT color=3D#008080>DataTable</FONT> = photoDataTable=3D=20 <FONT color=3D#0000ff>new</FONT> <FONT=20 color=3D#008080>DataTable</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>();<BR><FONT color=3D#0000ff>private</FONT> <FONT=20 color=3D#008080>ObservableCollection</FONT>&lt;<FONT=20 color=3D#008080>Photo</FONT>&gt; photos =3D <FONT = color=3D#0000ff>new</FONT> <FONT=20 color=3D#008080>ObservableCollection</FONT>&lt;<FONT=20 color=3D#008080>Photo</FONT></FONT></FONT><FONT face=3DCalibri><FONT=20 size=3D2>&gt;();<BR><FONT color=3D#0000ff>public</FONT> <FONT=20 color=3D#008080>ObservableCollection</FONT>&lt;<FONT=20 color=3D#008080>Photo</FONT>&gt; Photos { <FONT = color=3D#0000ff>get</FONT> { <FONT=20 color=3D#0000ff>return</FONT> <FONT = color=3D#0000ff>this</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>.photos; } }<BR><FONT = color=3D#0000ff>private</FONT>=20 <FONT color=3D#008080>DelegateCommand</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2> getDataCommand;<BR><FONT = color=3D#0000ff>public</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2> PhotosCollection()<BR>{<BR>getDataCommand = =3D <FONT=20 color=3D#0000ff>new</FONT> <FONT = color=3D#008080>DelegateCommand</FONT>(<FONT=20 color=3D#0000ff>delegate</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>() {=20 GetData(); });<BR>}<BR><FONT color=3D#0000ff>public</FONT> <FONT=20 color=3D#008080>DelegateCommand</FONT> GetDataCommand { <FONT=20 color=3D#0000ff>get</FONT> { <FONT = color=3D#0000ff>return</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2> getDataCommand; } }<BR><FONT=20 color=3D#0000ff>public</FONT> <FONT = color=3D#0000ff>void</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2> GetData()<BR>{<BR><FONT = color=3D#0000ff>string</FONT>=20 apiSig =3D FlickrAPI.<FONT = color=3D#008080>HelperMathods</FONT>.Md5Sum(<FONT=20 color=3D#800000>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</FONT><FONT=20 color=3D#800000>"</FONT></FONT></FONT><FONT face=3DCalibri><FONT=20 size=3D2>);<BR>FlickrAPI.<FONT color=3D#008080>Response</FONT> res =3D = <FONT=20 color=3D#0000ff>new</FONT> FlickrAPI.<FONT=20 color=3D#008080>Response</FONT></FONT></FONT><FONT face=3DCalibri><FONT=20 size=3D2>();<BR><FONT color=3D#0000ff>string</FONT> tempString =3D <FONT = color=3D#800000>""</FONT></FONT></FONT><FONT face=3DCalibri><FONT=20 size=3D2>;<BR>tempString =3D res.GetResponse(<FONT=20 color=3D#800000>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"</FONT></FONT></= FONT><FONT=20 face=3DCalibri><FONT size=3D2>);<BR><FONT = color=3D#008080>StringReader</FONT> sreader=20 =3D <FONT color=3D#0000ff>new</FONT> <FONT=20 color=3D#008080>StringReader</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2>(tempString);<BR>ds.ReadXml(sreader);<BR>photoDataTable=3Dds.Tab= les[<FONT=20 color=3D#800000>"photo"</FONT></FONT></FONT><FONT face=3DCalibri><FONT=20 size=3D2>];<BR>photos.Clear();<BR><FONT color=3D#0000ff>for</FONT> = (<FONT=20 color=3D#0000ff>int</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2> i =3D 0; i=20 &lt; photoDataTable.Rows.Count; i++)<BR>{<BR>photos.Add(<FONT=20 color=3D#0000ff>new</FONT> <FONT color=3D#008080>Photo</FONT>((<FONT=20 color=3D#0000ff>string</FONT>)photoDataTable.Rows<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">[0],=20 (<FONT color=3D#0000ff>string</FONT>)photoDataTable.Rows<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">[1],=20 (<FONT color=3D#0000ff>string</FONT>)photoDataTable.Rows<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">[2],=20 (<FONT color=3D#0000ff>string</FONT>)photoDataTable.Rows<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">[3],=20 (<FONT color=3D#0000ff>string</FONT>)photoDataTable.Rows<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">[4],=20 (<FONT color=3D#0000ff>string</FONT>)photoDataTable.Rows<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">[5],=20 (<FONT color=3D#0000ff>string</FONT>)photoDataTable.Rows<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif"><IMG=20 alt=3DDevil=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-14.gif">,=20 (<FONT color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri=20 size=3D2>)photoDataTable.Rows<IMG alt=3DIdea=20 src=3D"wlmailhtml:{82C8B1A2-11B8-4425-AE8A-31EDE3563FD6}mid://00000019/!h= ttp://forums.microsoft.com/MSDN//emoticons/emotion-55.gif">[7]));<BR>}<BR= ></FONT><FONT=20 face=3DCalibri size=3D2>}<BR>}</FONT></P> <P><FONT face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>public</FONT> <FONT=20 color=3D#0000ff>class</FONT> </FONT></FONT><FONT face=3DCalibri = color=3D#008080=20 size=3D2>Photo<BR></FONT><FONT face=3DCalibri><FONT size=3D2>{<BR><FONT=20 color=3D#0000ff>private</FONT> <FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 id;<BR><FONT color=3D#0000ff>private</FONT> <FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 owner;<BR><FONT color=3D#0000ff>private</FONT> <FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 secret;<BR><FONT color=3D#0000ff>private</FONT> <FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 server;<BR><FONT color=3D#0000ff>private</FONT> <FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 title;<BR><FONT color=3D#0000ff>private</FONT> <FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 ispublic;<BR><FONT color=3D#0000ff>private</FONT> <FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 isfriend;<BR><FONT color=3D#0000ff>private</FONT> <FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 isfamily;<BR><FONT color=3D#0000ff>private</FONT> <FONT=20 color=3D#008080>String</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 photoURL;<BR><FONT color=3D#0000ff>public</FONT> Photo(<FONT=20 color=3D#0000ff>string</FONT> id, <FONT color=3D#0000ff>string</FONT> = owner, <FONT=20 color=3D#0000ff>string</FONT> secret, <FONT = color=3D#0000ff>string</FONT> server,=20 <FONT color=3D#0000ff>string</FONT> title, <FONT = color=3D#0000ff>string</FONT>=20 ispublic, <FONT color=3D#0000ff>string</FONT> isfriend, <FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 isfamily)<BR>{<BR><FONT color=3D#0000ff>this</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>.id =3D id;<BR><FONT=20 color=3D#0000ff>this</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>.owner =3D=20 owner;<BR><FONT color=3D#0000ff>this</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2>.secret =3D secret;<BR><FONT = color=3D#0000ff>this</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>.server=3Dserver;<BR><FONT=20 color=3D#0000ff>this</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>.title =3D=20 title;<BR><FONT color=3D#0000ff>this</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2>.ispublic =3D ispublic;<BR><FONT=20 color=3D#0000ff>this</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>.isfriend=20 =3D isfriend;<BR><FONT color=3D#0000ff>this</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>.isfamily =3D = isfamily;<BR>photoURL=3D(<FONT=20 color=3D#800000>"http://static.flickr.com/"</FONT>+<FONT=20 color=3D#0000ff>this</FONT>.server+<FONT = color=3D#800000>"/"</FONT>+<FONT=20 color=3D#0000ff>this</FONT>.id+<FONT color=3D#800000>"_"</FONT>+<FONT=20 color=3D#0000ff>this</FONT>.secret+<FONT=20 color=3D#800000>"_t.jpg"</FONT></FONT></FONT><FONT face=3DCalibri><FONT=20 size=3D2>);<BR><FONT color=3D#0000ff>this</FONT></FONT></FONT><FONT = face=3DCalibri=20 size=3D2>.thumbNailPhoto =3D ImageFromString(photoURL);<BR>}</FONT></P> <P><FONT face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>public</FONT> <FONT=20 color=3D#008080>ImageSource</FONT></FONT></FONT><FONT = face=3DCalibri><FONT size=3D2>=20 ThumbNailPhoto<BR>{<BR><FONT color=3D#0000ff>get</FONT> { <FONT=20 color=3D#0000ff>return</FONT> <FONT = color=3D#0000ff>this</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>.thumbNailPhoto; }<BR>}<BR><FONT=20 color=3D#008080>ImageSource</FONT></FONT></FONT><FONT = face=3DCalibri><FONT size=3D2>=20 thumbNailPhoto;<BR><FONT color=3D#0000ff>public</FONT> <FONT=20 color=3D#008080>ImageSource</FONT> ImageFromString(<FONT=20 color=3D#0000ff>string</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2>=20 url)<BR>{<BR><FONT color=3D#008080>BitmapImage</FONT> image =3D <FONT=20 color=3D#0000ff>null</FONT></FONT></FONT><FONT face=3DCalibri><FONT=20 size=3D2>;<BR><FONT color=3D#0000ff>if</FONT> (url !=3D <FONT=20 color=3D#0000ff>null</FONT></FONT></FONT><FONT face=3DCalibri><FONT=20 size=3D2>)<BR>{<BR>image =3D <FONT color=3D#0000ff>new</FONT> <FONT=20 color=3D#008080>BitmapImage</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2>();<BR>image.BeginInit();<BR>image.UriSource =3D <FONT=20 color=3D#0000ff>new</FONT> <FONT = color=3D#008080>Uri</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>(url);<BR>image.EndInit();<BR>}<BR><FONT=20 color=3D#0000ff>return</FONT></FONT></FONT><FONT face=3DCalibri = size=3D2>=20 image;<BR>}<BR>}</FONT></P> <P><FONT face=3DCalibri size=3D2>I am pretty sure that it is a very = st*** mistake..=20 But I cannot figure out what is the mistake....</FONT></P> <P><FONT face=3DCalibri size=3D2>Any help is really = appreciated.</FONT></P> <P><FONT face=3DCalibri size=3D2>Thanks,<BR>M.V.</FONT></P></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML> ------=_NextPart_001_001E_01C6C480.607AB3F0-- ------=_NextPart_000_001D_01C6C480.607AB3F0 Content-Type: image/gif; name="emotion-55.gif" Content-Transfer-Encoding: base64 Content-Location: http://forums.microsoft.com/MSDN//emoticons/emotion-55.gif R0lGODlhEwATAMQeANSfVf//VdTf/6p/ANS/VVVfVX9fVf/fVdTfqv/f/6q/qlU/VabK8KqfVYCA ANSfqszM/6pfVX+fqipfVaCgpICAgKqfqv/fqqp/VdS/qsDcwP//qv/78P///////wAAACH5BAEA AB4ALAAAAAATABMAAAW34KB5JJmdY0kOXRal3kkQgKVi2agJnpZdnI2Q8EhxdiUfJ3gIXDYETIJD opqeF6dQeOKpYpumMChEAGCYgaeRfW6WS7OFk9ZoOBbtG87J1DheJgAbAXsdHX0YCh5WJRgHG0BL HQgGFjAqGhgEWxwNBhSYXxoVgxsYlhoJXx5qgkKgIxwOGY45qxYFFRUFFl4ZGLIcECkUFAwUCwqN diWNFBIMvIusrBS7Ews21V8cuwWh3NV2oiUhADs= ------=_NextPart_000_001D_01C6C480.607AB3F0 Content-Type: image/gif; name="emotion-14.gif" Content-Transfer-Encoding: base64 Content-Location: http://forums.microsoft.com/MSDN//emoticons/emotion-14.gif R0lGODlhEwATANUjANQ/Vaq/qtQ/AP9fVdQfAKofVaofAFUfVdQfVdSfqtTf/6p/qv8/VSp/qip/ /1V/qtR/qv/78ICAgKp/VdSfVf/f//8/AKqfqqo/VdS/qn8fANRfVcDcwKpfVao/AFUfAP9/VdR/ Vf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACMALAAAAAATABMAAAbZwJGw gxEajZ5N5jjaGC4cpjBT6ESnGMHiysx4CBdjB2HoJKSjDqB69WA8iOTAAhBsMAR8ZznK5DsMHx8a ISEbgx8YHQFiHoUUICAaIB8gGwAeUEYJAyEghaCRIAZbR4aFkgeRIYIbVkedhR8iEZWzIh8FfEIM oBoRDoQaIg8aAoxGAqgHDQ+OzA4eBWFGAJ+RHgeeIB4fGx7IQiEDn76CkQCLRxkAocMiuNylRxAC Axues5UGEgEKUhA8WNtA6c4ETWgSdIDjpoMEhGhGKOAQ4MKFDBwUVDgSBAA7 ------=_NextPart_000_001D_01C6C480.607AB3F0-- Tag: 'System.InvalidOperationException' Tag: 120648
      • 23
        • .Net Equivalent to a VBS Script? Is there a way to build a .net file in C# which will JIT compile and execute when double-clicked (a la the old .vbs scripting approach)? This would just be a nice, convenient way for me to do some scripting where I don't want to have to build a whole project and application. Alex Tag: 'System.InvalidOperationException' Tag: 120647
      • 24
        • Bogus "Cannot find the assembly" exception I have a very strange error; an ASP page invokes a method through .NET remoting which returns an exception as an output parameter. Unfortunately, no matter what exception the method returns, it appears as a different one ("Cannot find the assembly") to the ASP page. To clarify, I have an interface class called called IGetBoardInfo, which provides the interface for one method. I have a Windows service that exposes (through remoting) a class called GetBoardInfo, which implements the interface. It uses a class library called SubComponent, which can throw custom exceptions. Finally, an ASP webpage instantiates the GetBoardInfo class and calls its method. When it does, the GetBoardInfo class calls SubComponent, which throws a SubComponentException, which is returned via output parameter back to the ASP page. The problem is, which the ASP page tries to display the exception's message, this is the exception that appears: "Cannot find the assembly 'SubComponent', Version=1.0.1.2, Culture=neutral, PublicKeyToken=null." This is not the exception that was actually thrown. How is the real exception getting obscured, and this other exception being shown instead? Here is some much-simplified code that illustrates what I'm talking about: The interface class is specified like this: namespace TE.Service.IGetBoardInfo { [Serializable()] public struct BoardInfo { public long m_ID; public long m_siteNumber; } public interface IBoardInfo { BoardInfo[] GetBoardInfo(out Exception o_exception); } } The service itself is called GetBoardInfoSvc, and uses a C# class library called SubComponent. public class BoardInfoRpcServer : MarshalByRefObject, IBoardInfo { public BoardInfo[] GetBoardInfo(out Exception o_exception) { o_exception = null; BoardInfo[] info = null; try { // this line throws a SubComponentException info = SubComponentNamespace.SubComponent.GetBoards(); } catch(Exception e) { o_exception = e; info = null; } return info; } } The webpage has code that looks like this: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As ystem.EventArgs) Handles MyBase.Load Dim url as String = "tcp://myComputerName:555/GetBoardInfo.rpc" Dim obj As IBoardInfo = Activator.GetObject(GetType(IBoardInfo), url) Dim exBoardInfo As Exception Dim strBoards() As BoardInfo = obj.GetBoardInfo(exBoardInfo) ' At this point, exBoardInfo is "Cannot find the assembly 'SubComponent'", ' which is not the exception that was originally thrown. End Sub Tag: 'System.InvalidOperationException' Tag: 120646
      • 25
        • WPF Listox and Listbox update problem..... This is a multi-part message in MIME format. ------=_NextPart_000_003E_01C6C470.F07C7F70 Content-Type: multipart/alternative; boundary="----=_NextPart_001_003F_01C6C470.F07C7F70" ------=_NextPart_001_003F_01C6C470.F07C7F70 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable =20 I have built an WPF application that gets links to photos from a web = service (flickr) and used the following code to achieve it: <Button HorizontalAlignment=3D"Stretch" VerticalAlignment=3D"Stretch" = Margin=3D"31,10,39.0000000000001,17" Width=3D"Auto" Height=3D"Auto" = x:Name=3D"Button" Content=3D"Get Photos" = RenderTransformOrigin=3D"-0.462962962962963,-0.40625" = Grid.ColumnSpan=3D"1" Grid.RowSpan=3D"1" Command=3D"{Binding = GetDataCommand, Mode=3DDefault, Source=3D{StaticResource = PhotosCollectionDS}}"> <Button.RenderTransform> <TransformGroup> <TranslateTransform X=3D"0" Y=3D"0"/> <ScaleTransform ScaleX=3D"1" ScaleY=3D"1"/> <SkewTransform AngleX=3D"0" AngleY=3D"0"/> <RotateTransform Angle=3D"0"/> <TranslateTransform X=3D"0" Y=3D"0"/> <TranslateTransform X=3D"0" Y=3D"0"/> </TransformGroup> </Button.RenderTransform> </Button> <ListBox HorizontalAlignment=3D"Stretch" Margin=3D"12,21,12,10" = Width=3D"Auto" x:Name=3D"ListBox" Grid.Row=3D"1" Grid.ColumnSpan=3D"1" = ItemsSource=3D"{Binding Photos, Mode=3DDefault, Source=3D{StaticResource = PhotosCollectionDS}}" ItemTemplate=3D"{DynamicResource = PhotosTemplate}"/> Then I have tried to modify this using Visual Studio so that the Click = event is handled in the codebehind file <Button.... = Click=3D"OnButtonClick">.....</Button> have tried calling refresh() on the listbox items but this didn't = work...=20 If I use the code in the previous post, everything works fine.... If I use the following code, the thing does not work.... <Grid=20 xmlns=3D"http://schemas.microsoft.com/winfx/2006/xaml/presentation"=20 xmlns:x=3D"http://schemas.microsoft.com/winfx/2006/xaml"=20 xmlns:mc=3D"http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d=3D"http://schemas.microsoft.com/expression/interactivedesigner/20= 06" mc:Ignorable=3D"d" Background=3D"#FFFFFFFF"=20 x:Name=3D"DocumentRoot" x:Class=3D"UntitledProject1.Scene1"=20 Width=3D"640" Height=3D"480" = xmlns:FlickrAPI=3D"clr-namespace:FlickrAPI;assembly=3DFlickrActivityLibra= ry"> <Grid.Resources> <Storyboard x:Key=3D"OnLoaded"/> <ObjectDataProvider x:Key=3D"PhotosCollectionDS" d:IsDataSource=3D"True" = ObjectType=3D"{x:Type FlickrAPI:PhotosCollection}"/> <DataTemplate x:Key=3D"PhotosTemplate"> <StackPanel x:Name=3D"StackPanel"> <Image x:Name=3D"Image" Source=3D"{Binding ThumbNailPhoto}"/> </StackPanel> </DataTemplate> </Grid.Resources> <Grid.Triggers> <EventTrigger RoutedEvent=3D"FrameworkElement.Loaded"> <BeginStoryboard x:Name=3D"OnLoaded_BeginStoryboard" = Storyboard=3D"{DynamicResource OnLoaded}"/> </EventTrigger> </Grid.Triggers> <Grid.ColumnDefinitions> <ColumnDefinition Width=3D"0.3046875*"/> <ColumnDefinition Width=3D"0.6953125*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height=3D"0.13125*"/> <RowDefinition Height=3D"0.86875*"/> </Grid.RowDefinitions> <Button HorizontalAlignment=3D"Stretch" VerticalAlignment=3D"Stretch" = Margin=3D"31,10,39.0000000000001,17" Width=3D"Auto" Height=3D"Auto" = x:Name=3D"Button" Content=3D"Get Photos" = RenderTransformOrigin=3D"-0.462962962962963,-0.40625" = Grid.ColumnSpan=3D"1" Grid.RowSpan=3D"1" Click=3D"OnButtonClick"> <Button.RenderTransform> <TransformGroup> <TranslateTransform X=3D"0" Y=3D"0"/> <ScaleTransform ScaleX=3D"1" ScaleY=3D"1"/> <SkewTransform AngleX=3D"0" AngleY=3D"0"/> <RotateTransform Angle=3D"0"/> <TranslateTransform X=3D"0" Y=3D"0"/> <TranslateTransform X=3D"0" Y=3D"0"/> </TransformGroup> </Button.RenderTransform> </Button> <ListBox HorizontalAlignment=3D"Stretch" Margin=3D"12,21,12,10" = Width=3D"Auto" x:Name=3D"ListBox" Grid.Row=3D"1" Grid.ColumnSpan=3D"1" = ItemsSource=3D"{Binding Photos, Mode=3DDefault, Source=3D{StaticResource = PhotosCollectionDS}}" ItemTemplate=3D"{DynamicResource = PhotosTemplate}"/> </Grid> The problematic part is in Black and bolded. Now the OnButtonClick is = defined as follows: public void OnButtonClick(object sender, EventArgs e) { InitializeWorkflow(); instance.Start(); string tempString =3D ""; waitHandle.WaitOne(); for (int i =3D 0; i < ds1.Tables.Count; i++) { for (int j =3D 0; j < ds1.Tables.Rows.Count; j++) { tempString =3D tempString + "Table: {" + ds1.Tables.TableName + "}, Row: = {" + j + "}:" + "\n"; for (int k =3D 0; k < ds1.Tables.Columns.Count; k++) { tempString =3D tempString + "Table: {" + ds1.Tables.TableName + "}, = Column: {" + ds1.Tables.Columns[k].ColumnName + "}, Value: {" + = ds1.Tables.Rows[j][k] + "}" + "\t"; } //Console.WriteLine("Table: {0}, Column: {1}, Value: {2}", = ds.Tables.TableName, ds.Tables.Columns[j].ColumnName, ds.Tables.); } } System.Windows.MessageBox.Show(tempString); FlickrAPI.PhotosCollection pc =3D new FlickrAPI.PhotosCollection(); pc.ds =3D ds1; pc.GetData(); //This should populate the listBox } And the part where GetDataCommand is defined is: public class PhotosCollection { public DataSet ds=3D new DataSet(); private static DataTable photoDataTable=3D new DataTable(); private ObservableCollection<Photo> photos =3D new = ObservableCollection<Photo>(); public ObservableCollection<Photo> Photos { get { return this.photos; } = } private DelegateCommand getDataCommand; public PhotosCollection() { getDataCommand =3D new DelegateCommand(delegate() { GetData(); }); } public DelegateCommand GetDataCommand { get { return getDataCommand; } } public void GetData() { string apiSig =3D = FlickrAPI.HelperMathods.Md5Sum("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"= ); FlickrAPI.Response res =3D new FlickrAPI.Response(); string tempString =3D ""; tempString =3D = res.GetResponse("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); StringReader sreader =3D new StringReader(tempString); ds.ReadXml(sreader); photoDataTable=3Dds.Tables["photo"]; photos.Clear(); for (int i =3D 0; i < photoDataTable.Rows.Count; i++) { photos.Add(new Photo((string)photoDataTable.Rows[0], = (string)photoDataTable.Rows[1], (string)photoDataTable.Rows[2], = (string)photoDataTable.Rows[3], (string)photoDataTable.Rows[4], = (string)photoDataTable.Rows[5], (string)photoDataTable.Rows, = (string)photoDataTable.Rows[7])); } } } public class Photo { private string id; private string owner; private string secret; private string server; private string title; private string ispublic; private string isfriend; private string isfamily; private String photoURL; public Photo(string id, string owner, string secret, string server, = string title, string ispublic, string isfriend, string isfamily) { this.id =3D id; this.owner =3D owner; this.secret =3D secret; this.server=3Dserver; this.title =3D title; this.ispublic =3D ispublic; this.isfriend =3D isfriend; this.isfamily =3D isfamily; photoURL=3D("http://static.flickr.com/"+this.server+"/"+this.id+"_"+this.= secret+"_t.jpg"); this.thumbNailPhoto =3D ImageFromString(photoURL); } public ImageSource ThumbNailPhoto { get { return this.thumbNailPhoto; } } ImageSource thumbNailPhoto; public ImageSource ImageFromString(string url) { BitmapImage image =3D null; if (url !=3D null) { image =3D new BitmapImage(); image.BeginInit(); image.UriSource =3D new Uri(url); image.EndInit(); } return image; } } I am pretty sure that it is a very st*** mistake.. But I cannot figure = out what is the mistake.... Any help is really appreciated. Thanks, M.V. ------=_NextPart_001_003F_01C6C470.F07C7F70 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dwindows-1250"> <STYLE></STYLE> <META content=3D"MSHTML 6.00.5450.4" name=3DGENERATOR></HEAD> <BODY id=3DMailContainerBody=20 style=3D"PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px"=20 bgColor=3D#ffffff leftMargin=3D0 topMargin=3D0 CanvasTabStop=3D"true" = acc_role=3D"text"=20 name=3D"Compose message area"><SPAN><FONT face=3DCalibri = size=3D2>&nbsp;</FONT>=20 <P><FONT face=3DCalibri size=3D2>I have built an WPF application that = gets links to=20 photos from a web service (flickr) and used the following code to = achieve=20 it:</FONT></P><FONT color=3D#0000ff> <P><FONT face=3DCalibri size=3D2>&lt;</FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#800000>Button</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>HorizontalAlignment</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Stretch</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>VerticalAlignment</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Stretch</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Margin</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>31,10,39.0000000000001,17</FONT>"<FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>Width</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Auto</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Height</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Auto</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Button</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Content</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>Get=20 Photos</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>RenderTransformOrigin</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>-0.462962962962963,-0.40625</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Grid.ColumnSpan</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>1</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Grid.RowSpan</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Command</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>{Binding GetDataCommand, Mode=3DDefault, = Source=3D{StaticResource=20 PhotosCollectionDS}}</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>Button.RenderTransform</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TransformGroup</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TranslateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>X</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Y</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT = color=3D#800000>ScaleTransform</FONT><FONT=20 color=3D#0000ff> </FONT><FONT color=3D#ff0000>ScaleX</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>1</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>ScaleY</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT = color=3D#800000>SkewTransform</FONT><FONT=20 color=3D#0000ff> </FONT><FONT color=3D#ff0000>AngleX</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>0</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>AngleY</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>RotateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>Angle</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TranslateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>X</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Y</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;</FONT><FONT=20 color=3D#800000>TranslateTransform</FONT><FONT color=3D#0000ff> = </FONT><FONT=20 color=3D#ff0000>X</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Y</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>0</FONT>"</FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>/&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>TransformGroup</FONT></FONT></FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff>&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Button.RenderTransform</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>&gt;<BR>&lt;/</FONT><FONT=20 color=3D#800000>Button</FONT></FONT></FONT><FONT face=3DCalibri><FONT = size=3D2><FONT=20 color=3D#0000ff>&gt;<BR>&lt;</FONT><FONT = color=3D#800000>ListBox</FONT><FONT=20 color=3D#0000ff> </FONT><FONT = color=3D#ff0000>HorizontalAlignment</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>Stretch</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Margin</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>12,21,12,10</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Width</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>Auto</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>ListBox</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Grid.Row</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>Grid.ColumnSpan</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>1</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>ItemsSource</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>{Binding Photos, Mode=3DDefault, = Source=3D{StaticResource=20 PhotosCollectionDS}}</FONT>"<FONT color=3D#0000ff> </FONT><FONT=20 color=3D#ff0000>ItemTemplate</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>{DynamicResource PhotosTemplate}</FONT>"<FONT=20 color=3D#0000ff>/&gt;</FONT></FONT></FONT></P> <P><FONT face=3DCalibri color=3D#000000 size=3D2>Then I have tried to = modify this=20 using Visual Studio so that the Click event is handled in the codebehind = file=20 &lt;Button.... = Click=3D"OnButtonClick"&gt;.....&lt;/Button&gt;</FONT></P></SPAN> <DIV><FONT face=3DCalibri size=3D2>have tried calling refresh() on the = listbox items=20 but this didn't work...</FONT>=20 <P><FONT face=3DCalibri size=3D2>If I use the code in the previous post, = everything=20 works fine....</FONT></P> <P><FONT face=3DCalibri size=3D2>If I use the following code, the thing = does not=20 work....</FONT></P><FONT color=3D#0000ff> <P><FONT face=3DCalibri size=3D2>&lt;</FONT></FONT><FONT face=3DCalibri = color=3D#800000=20 size=3D2>Grid</FONT><FONT face=3DCalibri><FONT size=3D2><FONT = color=3D#0000ff>=20 <BR></FONT><FONT color=3D#ff0000>xmlns</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>http://schemas.microsoft.com/winfx/2006/xaml/presentation= </FONT>"</FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT color=3D#0000ff> <BR></FONT><FONT=20 color=3D#ff0000>xmlns:x</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>http://schemas.microsoft.com/winfx/2006/xaml</FONT>"</FON= T></FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT color=3D#0000ff> <BR></FONT><FONT=20 color=3D#ff0000>xmlns:mc</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>http://schemas.openxmlformats.org/markup-compatibility/20= 06</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>"<BR><FONT = color=3D#ff0000>xmlns:d</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>http://schemas.microsoft.com/expression/interactivedesign= er/2006</FONT></FONT></FONT><FONT=20 face=3DCalibri><FONT size=3D2>"<BR><FONT = color=3D#ff0000>mc:Ignorable</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>d</FONT></FONT></FONT><FONT=20 face=3DCalibri size=3D2>"<BR><FONT = color=3D#ff0000>Background</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT = color=3D#0000ff>#FFFFFFFF</FONT>"</FONT><FONT=20 face=3DCalibri><FONT size=3D2><FONT color=3D#0000ff> <BR></FONT><FONT=20 color=3D#ff0000>x:Name</FONT><FONT color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>DocumentRoot</FONT></FONT></FONT><FONT face=3DCalibri=20 size=3D2>"<BR><FONT color=3D#ff0000>x:Class</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>UntitledProject1.Scene1</FONT>"</FONT><FONT = face=3DCalibri><FONT=20 size=3D2><FONT color=3D#0000ff> <BR></FONT><FONT = color=3D#ff0000>Width</FONT><FONT=20 color=3D#0000ff>=3D</FONT>"<FONT color=3D#0000ff>640</FONT>"<FONT = color=3D#0000ff>=20 </FONT><FONT color=3D#ff0000>Height</FONT><FONT = color=3D#0000ff>=3D</FONT>"<FONT=20 color=3D#0000ff>480</FONT>"<FONT color=3D#0000ff> </FONT><FONT