Daily Archives

Articles indexed Tuesday May 11 2010

Page 13/123 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Composing Silverlight Applications With MEF

    - by PeterTweed
    Anyone who has written an application with complexity enough to warrant multiple controls on multiple pages/forms should understand the benefit of composite application development.  That is defining your application architecture that can be separated into separate pieces each with it’s own distinct purpose that can then be “composed” together into the solution. Composition can be useful in any layer of the application, from the presentation layer, the business layer, common services or data access.  Historically people have had different options to achieve composing applications from distinct well known pieces – their own version of dependency injection, containers to aid with composition like Unity, the composite application guidance for WPF and Silverlight and before that the composite application block. Microsoft has been working on another mechanism to aid composition and extension of applications for some time now – the Managed Extensibility Framework or MEF for short.  With Silverlight 4 it is part of the Silverlight environment.  MEF allows a much simplified mechanism for composition and extensibility compared to other mechanisms – which has always been the primary issue for adoption of the earlier mechanisms/frameworks. This post will guide you through the simple use of MEF for the scenario of composition of an application – using exports, imports and composition.  Steps: 1.     Create a new Silverlight 4 application. 2.     Add references to the following assemblies: System.ComponentModel.Composition.dll System.ComponentModel.Composition.Initialization.dll 3.     Add a new user control called LeftControl. 4.     Replace the LayoutRoot Grid with the following xaml:     <Grid x:Name="LayoutRoot" Background="Beige" Margin="40" >         <Button Content="Left Content" Margin="30"></Button>     </Grid> 5.     Add the following statement to the top of the LeftControl.xaml.cs file using System.ComponentModel.Composition; 6.     Add the following attribute to the LeftControl class     [Export(typeof(LeftControl))]   This attribute tells MEF that the type LeftControl will be exported – i.e. made available for other applications to import and compose into the application. 7.     Add a new user control called RightControl. 8.     Replace the LayoutRoot Grid with the following xaml:     <Grid x:Name="LayoutRoot" Background="Green" Margin="40"  >         <TextBlock Margin="40" Foreground="White" Text="Right Control" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center" ></TextBlock>     </Grid> 9.     Add the following statement to the top of the RightControl.xaml.cs file using System.ComponentModel.Composition; 10.   Add the following attribute to the RightControl class     [Export(typeof(RightControl))] 11.   Add the following xaml to the LayoutRoot Grid in MainPage.xaml:         <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">             <Border Name="LeftContent" Background="Red" BorderBrush="Gray" CornerRadius="20"></Border>             <Border Name="RightContent" Background="Red" BorderBrush="Gray" CornerRadius="20"></Border>         </StackPanel>   The borders will hold the controls that will be imported and composed via MEF. 12.   Add the following statement to the top of the MainPage.xaml.cs file using System.ComponentModel.Composition; 13.   Add the following properties to the MainPage class:         [Import(typeof(LeftControl))]         public LeftControl LeftUserControl { get; set; }         [Import(typeof(RightControl))]         public RightControl RightUserControl { get; set; }   This defines properties accepting LeftControl and RightControl types.  The attrributes are used to tell MEF the discovered type that should be applied to the property when composition occurs. 14.   Replace the MainPage constructore with the following code:         public MainPage()         {             InitializeComponent();             CompositionInitializer.SatisfyImports(this);             LeftContent.Child = LeftUserControl;             RightContent.Child = RightUserControl;         }   The CompositionInitializer.SatisfyImports(this) function call tells MEF to discover types related to the declared imports for this object (the MainPage object).  At that point, types matching those specified in the import defintions are discovered in the executing assembly location of the application and instantiated and assigned to the matching properties of the current object. 15.   Run the application and you will see the left control and right control types displayed in the MainPage:   Congratulations!  You have used MEF to dynamically compose user controls into a parent control in a composite application model. In the next post we will build on this topic to cover using MEF to compose Silverlight applications dynamically in download on demand scenarios – so .xap packages can be downloaded only when needed, avoiding large initial download for the main application xap. Take the Slalom Challenge at www.slalomchallenge.com!

    Read the article

  • Business Choices and Evony

    - by Robert May
    Recently, I’ve been playing a game called Evony, and I finally decided to quit the game and thought I should warn others who might be tempted.  I also find a lot of insight with this game as an example.  A few of the companies that I’ve worked with or worked for have been like this and they are NOT good places to be. Evony is a joke designed to milk as much money out of people as possible.  As a professional software developer who mentors teams on how to build better software, here's what I see: They obviously offshore all development and have little oversight over that offshore development, and they probably have a small team at that.  Evidenced by the poor grammar throughout the game. They're seeking to maximize revenue and pushing to do as little development as possible, which would mean a small team. They're horribly understaffed in the customer support department as evidenced by never replying to this forum and never responding to bug reports or help requests (I've had one open with no response AT ALL for over a month . . .) They have way inadequate testing, no CI, and probably no automated unit tests.  You can see this by the poor grammar throughout the game and the type of bugs that show up. They aren't following a formal development process (no Agile, Waterfall, or anything else) as evidenced by their lack of predictable release cycle and lack of visibility. I'm guessing that the internal code base is terrible, otherwise, there wouldn't be an "Age II" that had nothing more than a new visual interface and a few rule tweaks.  This is also evidenced by the itty bitty scope of bug fixes and their inability to really fix bugs. Their Architect sucks.  Really, 42k user is all you can handle on a single server?  Could you REALLY not come up with a better way to scale to handle users?  They've built isolated worlds, instead of a single continuous world. Back to milking people for money--to really progress, you have to spend money. All of this adds up to knowing, deliberate actions on the part of management.  They CHOOSE to do this (like AOL choosing to send more discs instead of improve quality). So, what can we learn? This game will never really improve, since the bosses don't care, they're only in it for the money. The game will never have good support.  Again, the owners don't care. Giving them money only perpetuates this scam (and yes, I've given them money, way too much money. :() They don't care if you quit.  There's a new sucker born every day. Don't EVER go to work for them.  I've worked both with and for people like this and the culture is NEVER good. Ah well. Technorati Tags: Evony

    Read the article

  • Silverlight Cream for May 08, 2010 -- #858

    - by Dave Campbell
    In this Issue: Phil Middlemiss, Jaime Rodriguez, Senthil Kumar, Mike Snow, DaveDev, Gergely Orosz, Kirupa, Cheryl Simmons, András Velvárt, Dan Wahlin, Michael D. Brown, and Ben Rush. Shoutouts: Erik Mork and crew have their latest up: This Week In Silverlight – Where’s the Tablet? Chris Rouw has a good link post and instructions on WCF RIA services: Deploying and Configuring Silverlight 4 and WCF RIA Services From SilverlightCream.com: Quick and Easy Sscalable Rounded Bevels Phil Middlemiss duplicates some bevel-edged rectangles in Blend, and they look great. Now you don't have to import all the other PhotoShop bits to get those things looking the way you want! A transparent Windows PHONE FAQ Jaime Rodriguez combined a bunch of information into a WP7 FAQ that he's going to keep up to date, so bookmark the page. He also has links to the Training Kit, on and offline versions. Windows Phone Developer Training Kit April Refresh is now available for Download Thanks to Senthil Kumar, I found out there is an April refresh of the WP7 Training kit at Channel 9 -- go get yours now --- I'll still be here when you get back! Silverlight Tip of the Day #16 – Working with IgnoreImageCache Mike Snow's Tip of the day #16 covers IgnoreImageCache and like many other things in life, until you read Mike's post you may be surprised at how it works. DoodlePad – A fun, free, sketching application for Windows Phone 7 DaveDev has a new WP7 App up that lets you or your kids 'Doodle' on the phone... could be a note, or could be a drawing... good post with all the links you need to get this cranked up on the emulator. Printing in Silverlight: Printing Charts and Auto Scaling Gergely Orosz's latest post is a very useful one on auto-scaling charts to fit a printed page and then getting them to print. Smoothly Scrolling a ListBox Check out the smooth scrolling Kirupa has on the ListBox near the top of his post... all good stuff... you wanna know how to do that! Plus... it's dead simple and all in Blend :) http://www.sparklingclient.com/wheres-the-silverlight-tablet/ Cheryl Simmons has a great tip up at the SilverlightSDK if you haven't burned through to figure it out yet ... changing the watermark on a DatePicker control... looks great! The story of a wicked bug András Velvárt tells a story of a bug that just defied logic or being found. Read how he tracked it down and what it actually was... could save you some time. Story learned: if I have a problem that bad, I'm calling András :) Text Trimming in Silverlight 4 Dan Wahlin gives a quick run-through of what TextBox trimming is, and then by a good real example... check it out and start using it in your projects. Enterprise Patterns with WCF RIA Services Michael D. Brown has an article in MSDN Magazine on RIA Services. Great information and link-packed article, with all the source avialable for download. Building Custom Players with the Silverlight Media Framework Ben Rush has a nice long tutorial on the Silverlight Media Framework up on the MSDN Magazine site ... lots of information in there. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Excellent Windows Azure benchmarks

    - by Sarang
    The Extreme computing group has released a fairly comprehensive set of benchmarks  for almost all aspects of WA. They have also provided the source code to alleviate all doubts that may surface with the MSFT logo lurking around the top right of their homepage :) (Which also resides at a cloudapp.net url). The code is simple and the tests comprehensive enough to hold as data points for customer interactions. Add to it the clean no nonsense Silverlight charts to render the benchmarks and you are set to sell. Technorati Tags: Azure,Benchmark,Extreme Computing Group

    Read the article

  • Is Nick Clegg a man or a mouse?

    - by BizTalk Visionary
    Well we got the hung election so many of us wanted! I believe it really is time for electoral change. Why? Consider: the ConMen under Cameroon have polled 36% of the great British voting public – well those that got to vote!! That means 64% of us don’t want him as PM. So what gives him the right to govern? Well an ancient voting system ideal for two party politics. But for the last 30 years we’ve had multi-party politics and going forward we may see 4 or 5 parties stepping up. We have to set in place a system that makes this work! So what does that mean today: Nick has a golden chance to push forward the case and in fact the absolute right for the change. He needs to keep this in mind when he discusses coalition with both Labour and the ConMen. So the mouse approach: Decides it is only fair to side with the ‘biggest’ vote and team up with the ConMen. Chances of electoral change? Big fat zero. Chance of achieving any of his other targets. Big fat zero. Why? Simple (as the Meer Kat would say). Cameroon needs to become PM by hook or crook. Once PM he holds the whip hand. Labour will dump Brown and head off into Leadership race land, Clegg will be knocking on number 10, having meaningless meetings and seeing no reward. Finally while Labour is at 6‘s and 7’s  the ‘new’ PM will call a new election, gain the majority they need and dump luckless Nick!! So the man approach: Team up with Labour. As one of the conditions – Brown to go. Run referendum for PR. Get PR through then force Labour to have new election under PR. Nick now hero and should be in a much better place following a PR election!! The man bit is standing up to the media attack for supporting Labour. Come Nick – be a man for a better Britain!!

    Read the article

  • Is Nick Clegg a man or a mouse?

    - by BizTalk Visionary
    Well we got the hung election so many of us wanted! I believe it really is time for electoral change. Why? Consider: the ConMen under Cameroon have polled 36% of the great British voting public – well those that got to vote!! That means 64% of us don’t want him as PM. So what gives him the right to govern? Well an ancient voting system ideal for two party politics. But for the last 30 years we’ve had multi-party politics and going forward we may see 4 or 5 parties stepping up. We have to set in place a system that makes this work! So what does that mean today: Nick has a golden chance to push forward the case and in fact the absolute right for the change. He needs to keep this in mind when he discusses coalition with both Labour and the ConMen. So the mouse approach: Decides it is only fair to side with the ‘biggest’ vote and team up with the ConMen. Chances of electoral change? Big fat zero. Chance of achieving any of his other targets. Big fat zero. Why? Simple (as the Meer Kat would say). Cameroon needs to become PM by hook or crook. Once PM he holds the whip hand. Labour will dump Brown and head off into Leadership race land, Glegg will be knocking on number 10, having meaningless meetings and seeing no reward. Finally while Labour is at 6‘s and 7’s  the ‘new’ PM will call a new election, gain the majority they need and dump luckless Nick!! So the man approach: Team up with Labour. As one of the conditions – Brown to go. Run referendum for PR. Get PR through then force Labour to have new election under PR. Nick now hero and should be in a much better place following a PR election!! The man bit is standing up to the media attack for supporting Labour. Come Nick – be a man for a better Britain!!

    Read the article

  • Installing a DLL to Global assembly cache (GAC)

    - by DAXShekhar
    Install you DLL assembly by using the ‘gacutil.exe’, before installing the DLL ensure it has a strong name, to assign a strong name refer to the link Assigning a DLL strong name .   1) open the Command prompt, and navigate to the folder of gacutil. 2) To install a DLL assembly gacutil /I "C:\[PathToBinDirectoryInVSProject]\gac.dll" 3) To uninstall gacutil /U  “Name_of_The_DLL”

    Read the article

  • Assigning a DLL strong name

    - by DAXShekhar
    Hi Guys, few days back I needed to install few DLL  assemblies to GAC, since I hardly knew about this topic, so googled on the internet and here is what I learned; There is a utility named ‘gacutil.exe’ which is delivered with Visual studio and .NET framework ( search in your PC for gacutil.exe) or you can also download  from internet. Before installing the DLL to GAC , ensure that the DLL you want to install has a strong name. To assign a strong name follow these steps::   1) Open the visual studio and open your C# project 2) Right click on the project/Solution and click on properties. 3) Click on the ‘Signing’ tab 4) Select the check box Sign the assembly and select a strong key file . 5) You can also create a new key file by selecting new, click on new to create a key file, provide the name of the file and password 6) Now build your solution, the dll file generated has a strong name.

    Read the article

  • NServiceBus Generic Host and mqsvc.exe high CPU

    - by Michael Stephenson
    We have been doing some work with NServiceBus recently and observed some unusual behaviour which was caused by our mistake and seemed worthy of a small post.   The Scenario In our solution we were doing some standard NServiceBus stuff by pushing a message to a queue using NServiceBus.  We had a direct send/receive scenario rather than a publish/subscribe one.   The background process which was meant to collect the message and then process it was a normal NServiceBus message handler.  We would run the NServiceBus.Host.exe which would find the handler and then do the usual NServiceBus magic.   The Problem In this solution we were creating some automated tests around this module of the integration process to ensure that it would work well.  We had two tests.   Test 1 This test would start NServiceBus.Host.exe using the Process object, then seed a message to the queue via our web service façade sitting above the queue which wrapped NServiceBus.  The background process would then process the message and the test would check the message had been processed fine.   If all was well then the NServiceBus.Host.exe process was stopped.   Test 2 In test 2 we would do a very similar thing except that instead of starting the process the test would install NServiceBus.Host.exe as a windows service and then start the service before the test and once the test was executed it would stop the test.   The Results of the Tests Test 1 worked really well, however in test 2 we found that it didn’t really work at all, instead of doing the background process we were finding that between mqsvc.exe and NServiceBus.Host.exe the CPU on the machine was maxed and nothing was really happening.   The Solution After trying a few things we found it was the permissions on the queue were not set correctly.  Once this was resolved it all worked fine and CPU was not excessive and ran just like the console application.   I think the couple of take aways from this are:   Make sure you set the windows service for NserviceBus Generic Host to the right credentials When you install the generic host as a windows service then by default it will use the default windows credentials.  For any production like scenario you should be using a domain account to run the process as via the windows service. Make sure you have the queue set with the right permissions For the credentials you have used to configure the generic host as a windows service you should ensure that this user has the appropriate permissions for any queues it will interact with. Make sure you turn on the right logging configuration in NServiceBus When this wasnt working correctly we didnt know there was an issue, we were just experiencing the high CPU condition.  I am a little surprised that there wasnt something logged and that the process didnt crash.  I guess this could be by design bearing in mind that the process could be monitoring many queues.  In this point Im just saying that originally we didnt have all of the log4net logging which is available from NServiceBus turned on.  Its probably a good idea to have this turned on and configured until you are happy your solution is working fine.   Thanks to Ahmed Hashmi on my team who got this working in the end.

    Read the article

  • MOSS Search Error: Authentication failed because the remote party has closed the transport stream

    - by Cherie Riesberg
    http://support.microsoft.com/?id=962928 To resolve this issue, follow these steps: Stop the Office SharePoint Services Search service. To do this, follow these steps: Click Start, click Run, type cmd , and then click OK. At the command prompt, type net stop osearch, and then press ENTER. Type exit to exit the command prompt. Download and install the IIS 6.0 Resource Kit Tools. To obtain the IIS 6.0 Resource Kit Tools, visit the following Microsoft Web site: http://www.microsoft.com/downloads/details.aspx?familyid=56FC92EE-A71A-4C73-B628-ADE629C89499 (http://www.microsoft.com/downloads/details.aspx?familyid=56FC92EE-A71A-4C73-B628-ADE629C89499) On each server in the farm that has Office SharePoint 2007 installed, follow these steps: Click Start, click Run, type cmd , and then click OK. Navigate to the location of the IIS 6.0 Resource Kit Tools (default location is: C:\Program Files\IIS Resources\SelfSSL) At the command prompt, type selfssl /s:951338967 /v:1000, and then press ENTER. Notes For 64 bit Server, 951338967 is the default ID of the Office Server Web Services certificate. For 32 bit Server, 1720207907 is the default ID of the Office Server Web Services certificate. You can check the ID of Office Server Web Services from IIS. 1000 is the number of days that the certification will be valid. You need to execute the selfssl command on each MOSS Server in the farm which is running a "Office Server Web Services" site. SharePoint partly uses SSL name resolution in the background between farm servers, which users generally do not need to be aware of. Start the Office SharePoint Services Search service. To do this, follow these steps: At the command prompt, type net start osearch, and then press ENTER. Type exit to exit the command prompt. Download and install the following update to the .NET Framework 3.5 SP1. For more information, click the following article number to view the article in the Microsoft Knowledge Base: 959209  (http://support.microsoft.com/kb/959209/ ) An update for the .NET Framework 3.5 Service Pack 1 is available

    Read the article

  • Dynamic (C# 4.0) &amp; Var in a nutshell.

    - by mbcrump
    A Var is static typed - the compiler and runtime know the type. This can be used to save some keystrokes. The following are identical. Code Snippet var mike = "var demo"; Console.WriteLine(mike.GetType());  //Returns System.String   string mike2 = "string Demo"; Console.WriteLine(mike2.GetType()); //Returns System.String A dynamic behaves like an object, but with dynamic dispatch. The compiler doesn’t know anything about it at compile time. Code Snippet dynamic duo = "dynamic duo"; Console.WriteLine(duo.GetType()); //System.String //duo.BlowUp(); //A dynamic type does not know if this exist until run-time. Console.ReadLine(); To further illustrate this point, the dynamic type called “duo” calls a method that does not exist called BlowUp(). As you can see from the screenshot below, the compiler is reporting no errors even though BlowUp() does not exist. The program will compile fine. It will however throw a runtimebinder exception after it hits that line of code in runtime. Let’s try the same thing with a Var. This time, we get a compiler error that says BlowUp() does not exist. This program will not compile until we add a BlowUp() method.  I hope this helps with your understand of the two. If not, then drop me a line and I’ll be glad to answer it.

    Read the article

  • OData Mix10 &ndash; Part Dos

    - by Jon Dalberg
    The other day I had a snazzy post on fetching all the video (WMV) files from Mix ‘10. A simple, console application that grabbed the urls from the OData feed and downloaded the videos. I wanted to change that app to fire the OData query asynchronously so here’s what resulted: 1: static void Main(string[] args) 2: { 3: var mix = new Mix.EventEntities(new Uri("http://api.visitmix.com/OData.svc")); 4:   5: var temp = mix.Files.Where(f => f.TypeName == "WMV"); 6: var query = temp as DataServiceQuery<Mix.File>; 7:   8: query.BeginExecute(OnFileQueryComplete, query); 9:   10: // waiting... 11: Console.ReadLine(); 12: } 13:   14: static void OnFileQueryComplete(IAsyncResult result) 15: { 16: var query = result.AsyncState as DataServiceQuery<Mix.File>; 17: var response = query.EndExecute(result); 18:   19: var web = new WebClient(); 20:   21: var myVideos = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyVideos), "Mix10"); 22:   23: Directory.CreateDirectory(myVideos); 24:   25: foreach (Mix.File f in response) 26: { 27: var fileName = new Uri(f.Url).Segments.Last(); 28: Console.WriteLine(f.Url); 29: web.DownloadFile(f.Url, Path.Combine(myVideos, fileName)); 30: } 31: } There are two important things here that are not explained well in the MSDN docs: See lines 5 and 6? That’s where I query for the WMV files and it returns an IQueryable<T>. You *have* to cast that to a DataServiceQuery<T> and then call BeginExecute. The documented example does not filter so it didn’t show that step. Line 16 shows the correct way to get the previously executed DataServiceQuery<T> from the async result. If you looked at the MSDN example docs it shows (incorrectly) just casting the result, like this: // wrong var query = result as DataServiceQuery<Mix.File>; Other than those items it is relatively straight forward and we’re all async-ified. Enjoy!

    Read the article

  • Scribe Workbench Update Source

    - by Dave Noderer
    I’ve been working with a program Scribe, similar in function to SSIS although I’m still an SSIS fanboy!! The main feature my customer has Scribe for is to load data into Microsoft CRM 4.0. A lot of what I’ve been doing is loading campaigns into CRM which are staged in SQL Server but I need to mark each one as imported so it will not get imported again. The screen shot below shows how to setup the Source update. One important thing is that the source SQL table has to have a primary key defined (this was a staging table and I did not do that at first)

    Read the article

  • C# 4.0 Optional/Named Parameters Beginner&rsquo;s Tutorial

    - by mbcrump
    One of the interesting features of C# 4.0 is for both named and optional arguments.  They are often very useful together, but are quite actually two different things.  Optional arguments gives us the ability to omit arguments to method invocations. Named arguments allows us to specify the arguments by name instead of by position.  Code using the named parameters are often more readable than code relying on argument position.  These features were long overdue, especially in regards to COM interop. Below, I have included some examples to help you understand them more in depth. Please remember to target the .NET 4 Framework when trying these samples. Code Snippet using System;   namespace ConsoleApplication3 {     class Program     {         static void Main(string[] args)         {               //C# 4.0 Optional/Named Parameters Tutorial               Foo();                              //Prints to the console | Return Nothing 0             Foo("Print Something");             //Prints to the console | Print Something 0             Foo("Print Something", 1);          //Prints to the console | Print Something 1             Foo(x: "Print Something", i: 5);    //Prints to the console | Print Something 5             Foo(i: 5, x: "Print Something");    //Prints to the console | Print Something 5             Foo("Print Something", i: 5);       //Prints to the console | Print Something 5             Foo2(i3: 77);                       //Prints to the console | 77         //  Foo(x:"Print Something", 5);        //Positional parameters must come before named arguments. This will error out.             Console.Read();         }           static void Foo(string x = "Return Nothing", int i = 0)         {             Console.WriteLine(x + " " + i + Environment.NewLine);         }           static void Foo2(int i = 1, int i2 = 2, int i3 = 3, int i4 = 4)         {             Console.WriteLine(i3);         }     } }

    Read the article

  • SSIS ForEachLoop Container

    - by Leonard Mwangi
    I recently had a client request to create an SSIS package that would loop through a set of data in SQL tables to allow them to complete their data transformation processes. Knowing that Integration Services does have ForEachLoop Container, I knew the task would be easy but the moment I jumped into it I figured there was no straight forward way to accomplish the task since for each didn’t really have a loop through the table enumerator. With the capabilities of integration Services, I was still confident that it was possible it was just a matter of creativity to get it done. I set out to discover what different ForEach Loop Editor Enumerators did and settled with Variable Enumerator.  Here is how I accomplished the task. 1.       Drop your ForEach Loop Container in your WorkArea. 2.       Create a few SSIS Variable that will contain the data. Notice I have assigned MyID_ID variable a value of “TEST’ which is not evaluated either. This variable will be assigned data from the database hence allowing us to loop. 3.       In the ForEach Loop Editor’s Collection select Variable Enumerator 4.       Once this is all set, we need a mechanism to grab the data from the SQL Table and assigning it to the variable. Fig: Select Top 1 record Fig: Assign Top 1 record to the variable 5.       Now all that’s required is a house cleaning process that will update the table that you are looping so that you can be able to grab the next record   A look of the complete package

    Read the article

  • Procedure or function has too many arguments specified

    - by bullpit
    This error took me a while to figure out. I was using SqlDataSource with stored procedures for SELECT and UPDATE commands. The SELECT worked fine. Then I added UPDATE command and while trying to update, I would get this error: "Procedure of function has too many arguments specified" Apparently, good guys at .NET decided it is necessary to send SELECT parameters with the UPDATE command as well. So when I was sending the required parameters to the UPDATE sp, in reality, it was also getting my SELECT parameters, and thus failing. I had to add the extra parameters in the UPDATE stored procedure and make them NULLABLE so that they are not required....phew... Here is piece of SP with unused parameters. ALTER PROCEDURE [dbo].[UpdateMaintenanceRecord]        @RecordID INT     ,@District VARCHAR(255)     ,@Location VARCHAR(255)         --UNUSED PARAMETERS     ,@MTBillTo VARCHAR(255) = NULL     ,@SerialNumber VARCHAR(255) = NULL     ,@PartNumber VARCHAR(255) = NULL Update: I was getting that error because unkowingly, I had bound the extra fields in my GridVeiw with Bind() call. I changed all the extra one's, which did not need to be in Update, to Eval() and everything works fine.

    Read the article

  • Persistent Storage in Windows Phone 7

    - by Richard Jones
    Mark Arteaga – fellow MVP just helped me with this,  thought I’d share. Windows Phone 7 SilverLight supports persistent storage, which is a great way of saving settings betweens runs of your application. However I couldn’t get it to work. If you do this to create a persistant storage instance -    private IsolatedStorageSettings userSettings = IsolatedStorageSettings.ApplicationSettings; To retrieve settings do the following - string xx = userSettings[“SomeValue”].ToString();   Hiowever the bit that got me was how to save settings, you have todo this - userSettings.Add("Hello", DateTime.Now.ToShortTimeString());           userSettings.Save(); // <- This is the bit that got me   Hope this helps others

    Read the article

  • My Latest Books &ndash; Professional C# 2010 and Professional ASP.NET 4

    - by Bill Evjen
    My two latest books are out! Professional ASP.NET 4 in C# and VB Professional C# 4 and .NET 4 From the back covers: Take your web development to the next level using ASP.NET 4 ASP.NET is about making you as productive as possible when building fast and secure web applications. Each release of ASP.NET gets better and removes a lot of the tedious code that you previously needed to put in place, making common ASP.NET tasks easier. With this book, an unparalleled team of authors walks you through the full breadth of ASP.NET and the new and exciting capabilities of ASP.NET 4. The authors also show you how to maximize the abundance of features that ASP.NET offers to make your development process smoother and more efficient. Professional ASP.NET 4: Demonstrates ASP.NET built-in systems such as the membership and role management systems Covers everything you need to know about working with and manipulating data Discusses the plethora of server controls that are at your disposal Explores new ways to build ASP.NET, such as working with ASP.NET MVC and ASP.NET AJAX Examines the full life cycle of ASP.NET, including debugging and error handling, HTTP modules, the provider model, and more Features both printed and downloadable C# and VB code examples Start using the new features of C# 4 and .NET 4 right away The new C# 4 language version is indispensable for writing code in Visual Studio 2010. This essential guide emphasizes that C# is the language of choice for your .NET 4 applications. The unparalleled author team of experts begins with a refresher of C# basics and quickly moves on to provide detailed coverage of all the recently added language and Framework features so that you can start writing Windows applications and ASP.NET web applications immediately. Reviews the .NET architecture, objects, generics, inheritance, arrays, operators, casts, delegates, events, Lambda expressions, and more Details integration with dynamic objects in C#, named and optional parameters, COM-specific interop features, and type-safe variance Provides coverage of new features of .NET 4, Workflow Foundation 4, ADO.NET Data Services, MEF, the Parallel Task Library, and PLINQ Has deep coverage of great technologies including LINQ, WCF, WPF, flow and fixed documents, and Silverlight Reviews ASP.NET programming and goes into new features such as ASP.NET MVC and ASP.NET Dynamic Data Discusses communication with WCF, MSMQ, peer-to-peer, and syndication

    Read the article

  • Getting Windows Azure SDK 1.1 To Talk To A Local DB

    - by Richard Jones
    Just found this, if you’re using Azure 1.1,  which you probably will be if yo'u’ve moved to Visual Studio 2010. To change the default database to something other than sqlexpress for Development Storage do this - Look at this - http://msdn.microsoft.com/en-us/library/dd203058.aspx At the bottom it states -   Using Development Storage with SQL Server Express 2008 By default the local Windows Group BUILTIN\Administrator is not included in the SQL Server sysadmin server role on new SQL Server Express 2008 installations.  Add yourself to the sysadmin role in order to use the Development Storage Services on SQL Server Express 2008.  See SQL Server 2008 Security Changes for more information. Changing the SQL Server instance used by Development Storage By default, the Development Storage will use the SQL Express instance.  This can be changed by calling “DSInit.exe /sqlinstance:<SQL Server instance>” from the Windows Azure SDK command prompt.

    Read the article

  • A view from the call center for the Nashville Flood telethon

    - by Rob Foster
    I want to break away from my usual topic of something technical and talk about what I experienced tonight while working in the call center for the Nashville Flood telethon, which was broadcast on WSMV, CNN, and The Weather Channel.  We started receiving calls about 7pm local time and to be honest, I had no idea what to expect when going into this.  I mean, I'm a pretty good talker, but this is different...We had a good script of what to say and how we were supposed to say it, as well as paper forms and pens that we used to collect information from people who wanted to donate their money to help.  I took my first few calls pretty easily and it went pretty quick and easy.  Everyone was upbeat and happy to be in the call center as well as people happy to be donating money. Pizza, snacks, and soft drinks were flowing well.  Everyone is smiling and happy.  :) About 3 or 4 calls into my night, I got a call from a lady that had lost 2 family members in West Nashville who drowned in the floods.  She was crying when she called and I of course tried to console her.  She told me how bad her situation was, losing family members and much of her neighborhood.  After all this, she still just wanted to help other people.  She was donating all the money that she could to the telethon and I want to share a direct quote from her: "I want to donate this instead of buying flowers for my family members' funeral because people out there need help.". Please let me pause while I get myself together <again>.  That caught me so off guard (and still does). I had kids calling wanting to donate their allowance, open their piggy banks, whatever they could do.  These are kids.  Kids not much older than my boys.  Kids who should be focused on buying the next cool video game or toy or whatever but wanted to do something.  Everyone just seemed to want to help. I took calls from as far away as British Columbia as well and pretty much coast to coast.  how cool is that? Yet another thing that caught me off guard.  This kind lady that called from British Columbia told me how much she loved visiting Nashville and just hated to see this happen.  I belive that she said that she will be attending the CMA Fest this year too.  I was sure to tell her not to cancel her plans!  :) It felt like every call I took (and I took A LOT, as did everyone else) was very personal and heartfelt.  I've never had the privelage to do anything like this and fell lucky to have been able to help out with answering phones and logging donations.  Nashville will bounce back very quickly, people are out there day and night helping each other, and the spirits are very high here.  I hope that one day, my kids read this blog and better understand who they are, where they come from, and what the human spirt is and can be.  I love this city, I love the people here, I love the culture and even more than ever am proud to say that this is me.  This is us.  We are Nashville!

    Read the article

  • Silverlight Cream for May 06, 2010 -- #857

    - by Dave Campbell
    In this Issue: Alan Beasley, Josh Twist, Mike Snow(-2-, -3-), John Papa(-2-), David Kelley, and David Anson(-2-). Shoutout: John Papa posted a question: Do You Want be on Silverlight TV? From SilverlightCream.com: ListBox Styling (Part 3 - Additional Templates) in Expression Blend & Silverlight Alan Beasley has part 3 of his ListBox styling tutorial in Expression Blend up... another great tutorial and all the code. Securing Your Silverlight Applications Josh Twist has a nice long post up on Securing your Silverlight apps... definitions, services, various forms of authentication. Silverlight Tip of the Day #13 – Silverlight Mobile Development Mike Snow has Tip of the Day #13 up and is discussing creating Silverlight apps for WP7. Silverlight Tip of the Day #14 – Dynamically Loading a Control from a DLL on a Server Mike Snow's Tip #14 is step-by-step instructions for loading a UserControl from a DLL. Silverlight Tip of the Day #15 – Setting Default Browse in Visual Studio Mike Snow's Tip #15 is actually a Visual Studio tip -- how to set what browser your Silverlight app will launch in. Silverlight TV 24: eBay’s Silverlight 4 Simple Lister Application Here we are with Silverlight TV Thursday again! ... John Papa is interviewing Dave Wolf talking about the eBay Simple Lister app. Digitally Signing a XAP Silverlight John Papa has a post up about Digitally signing a Silverlight XAP. He actually is posting an excerpt from the Silverlight 4 Whitepaper he posted... and he has a link to the Whitepaper so we can all read the whole thing too! Hacking Silverlight Code Browser David Kelley has a very cool code browser up to keep track of all the snippets he uses... and we can too... this is a tremendous resource... thanks David! Simple workarounds for a visual problem when toggling a ContextMenu MenuItem's IsEnabled property directly David Anson dug into a ContextMenu problem reported by a couple readers and found a way to duplicate the problem plus a workaround while you're waiting for the next Toolkit drop. Upgraded my Windows Phone 7 Charting example to go with the April Developer Tools Refresh David Anson also has a post up describing his path from the previous WP7 code to the current upgrading his charting code. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Visual Studio 2010 Modeling and Architecture Tools

    - by MikeParks
    Jennifer Marsman (Microsoft Evangelist) and Cameron Skinner (Microsoft Visual Studio Product Unit Manager) recently stopped by our office while they were passing through Louisville on their tour to give us a presentation on the new Visual Studio 2010 Modeling and Architecture Tools. I checked out these new features when Visual Studio 2010 Beta versions originally rolled out and have been really impressed with this stuff ever since then. So it was pretty cool to actually learn some new techniques from Cameron himself since he helped write the actual code behind some of those features. If you've upgraded to Visual Studio 2010 recently I would highly recommend using the Architecture tools. They're awesome. If you want to make improvements to it, they even have their own SDK for it. There are plenty of blogs out there to show you how to use it. I've been waiting to find a tool that works like this where I can really analyze the code in solutions and projects and see how everything ties together. It's really handy if you're asked to work on a new project and aren't familiar with how it works. Just run the tools, analyze the DLL's, learn how everything works, and then you'll be ready to implement new code! It's a great tool to learn new systems quick and easy and it's all housed within the Visual Studio IDE. I just wanted to write a blog to brag about it a little bit, so I figured I'd throw this up here. It's a must have tool for Developers/Architects. Here's some screenshots of when I was using it earlier:   Thanks everyone! - Mike

    Read the article

  • Useful Extension Method for ICloneable

    - by DesigningCode
    In the past, I’ve had to put a type specific clone in each cloneable class, but with extension methods you can write a generic T specific clone class Program { static void Main(string[] args) { var b = new Blah() {X = 1, Y = 2}; var bb = b.Clone(); Console.WriteLine(string.Format("{0} {1}", bb.X, bb.Y)); } } public class Blah : ICloneable { public int X; public int Y; object ICloneable.Clone() { return MemberwiseClone(); } } public static class CloneExtension { public static T Clone<T>(this T o) where T : ICloneable { return (T)o.Clone(); } }

    Read the article

  • Selectively Exposing Functionallity in .Net

    - by David V. Corbin
    Any developer should be aware of the principles of encapsulation, cross-tier isolation, and cross-functional separation of concerns. However, it seems the few take the time to consider the adage of "minimal yet complete"1 when developing the software. Consider the exposure of "business objects" to the user interface. Some common situations occur: Accessing a given element requires a compound set of calls that do not "make sense" to the User Interface. More information than absolutely required is exposed to the user interface It would be much cleaner if a custom interface was provided that exposed exactly (and only) the information that is required by the consumer. Achieving this using conventional techniques would require the creation (and maintenance!) of custom classes to filter and transpose the information into the ideal format. Determining the ROI on this approach can be very difficult to ascertain, and as a result it is often ignored completely. There is another approach, which is largely made practical by virtual of the Action and Func delegates. From a callers point of view, the following two samples can be used interchangeably:     interface ISomeInterface     {         void SampleMethod1(string param);         string SamepleMethod2(string param);     }       class ISomeInterface     {         public Action<string> SampleMethod1 {get; }         public Func<string,string> SamepleMethod2 {get; }     }   The capabilities this simple changes enable are significant (and remember it does not cange the syntax at the call site): The delegates can be initialized to directly call the proper method of any target class. The delegates can be dynamically updated based on the current state. The "interface" can NOT be cast to the concrete class (which often exposes more functionallity). This patterns By limiting the interface to the exact functionallity required, the reduced surface area will typically result in lower development, testing and maintenance costs. We are currently in the process of posting a project on CodePlex which illustrates this (and many other) techniques which have proven helpful in creating robust yet flexible solutions that are highly efficient2 and maintainable. This post will be updated as soon as the project is published. 1) Credit: Scott  Meyers, Effective C++, Addison-Wesley 1992 2) For those who read my previous post on performance it should be noted that the use of delegates is on the same order of magnitude (actually a tiny amount faster) as conventional interfaces.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >