Asp.Net : Randomizzare una Lista con Linq

25. maggio 2010

Data una classe Employee

   1: public class Employee
   2: {
   3:     public int Id {get; set;}
   4:  
   5:     public string Name {get; set;}
   6: }

utilizzando Linq è possibile randomizzare facilmente una lista di oggetti Employee .

   1: ist<Employee> list = new List<Employee>();
   2:  
   3: list.Add(new Employee { Id = 1, Name = "Davolio Nancy" });
   4: list.Add(new Employee { Id = 2, Name = "Fuller Andrew" });
   5: list.Add(new Employee { Id = 3, Name = "Leverling Janet" });
   6: list.Add(new Employee { Id = 4, Name = "Peacock Margaret" });
   7: list.Add(new Employee { Id = 5, Name = "Buchanan Steven" });
   8: list.Add(new Employee { Id = 6, Name = "Suyama Michael" });
   9: list.Add(new Employee { Id = 7, Name = "King Robert" });
  10: list.Add(new Employee { Id = 8, Name = "Callahan Laura" });
  11: list.Add(new Employee { Id = 9, Name = "Dodsworth Anne" });
  12:  
  13: list = list.OrderBy(x => Guid.NewGuid()).ToList();

asp.net, Tips , ,

Asp.net : FindControl su un controllo CreateUserWizard

19. maggio 2010
Codice per recuperare un controllo contenuto in un CreateUserWizard :
   1: Label lb = CreateUserWizard1.CompleteStep.ContentTemplateContainer.FindControl("lblUsername") as Label; 
oppure nel caso di un TemplateWizardStep
   1: TemplatedWizardStep step = (TemplatedWizardStep) CreateUserWizard1.WizardSteps[1];
   2: Label lb = (Label)step.ContentTemplateContainer.FindControl("label1");
oppure più semplicemente
   1: Label lb = (Label)MyStep.ContentTemplateContainer.FindControl("label1");
dove MyStep è un TemplateWizardStep
   1: <asp:TemplatedWizardStep ID="MyStep" runat="server" Title="Name of step">
   2:     <ContentTemplate>
   3: ...
   4: ...

asp.net, Tips ,

Open DBDiff : Eccellente alternativa GRATUITA a Red Gate SQL Compare

11. aprile 2010

Per chi non dispone del budget necessario ad acquistare una licenza di Red Gate SQL Compare su CodePlex si può scaricare Open DBDiff

Descrizione del progetto

Open DBDiff è uno strumento open source per confrontare schemi di database SQL Server 2005/2008. 

Visualizza le differenze tra due schemi di database e fornisce uno script di sincronizzazione per aggiornare un database da una all'altra.

Con DBDiff è possibile sincronizzare

  • Tabelle
  • Le colonne 
  • Vincoli
  • Indici 
  • Schemi XML
  • Tipi di tabelle
  • Tipi di dati utente
  • Gli oggetti CLR 
  • Trigger 
  • Sinonimi
  • Schemi
  • Gruppi di file
  • Viste
  • Funzioni
  • Store Procedure
  • Funzioni di Partizione / Schemi
  • Utenti
  • Ruoli

 

.Net, Tips , , ,

Un tuffo nei videogames anni 80 !!

9. aprile 2010

Spettacolare video per i nostalgici dei videogames anni 80 !



PIXELS by PATRICK JEAN.
Caricato da onemoreprod. - Scopri altri video creativi.

Curiosità ,

Microsoft SQL Server 2008 Management Studio Express Stand-alone

29. gennaio 2010

Microsoft SQL Server 2008 Management Studio Express è un ambiente gratuito e integrato per accedere, configurare, gestire, amministrare e sviluppare tutti i componenti di SQL Server. Esso combina un gruppo esteso di strumenti grafici con diversi editor di script complessi per consentire a sviluppatori e amministratori con qualsiasi livello di esperienza di accedere a SQL Server.

Disponibile a questo indirizzo in versione Stand-alone, senza installazione di Sql Server 2008, sia a 32-bit (168.3 MB) che a 64-bit (176.5 MB):

https://www.microsoft.com/downloads/details.aspx?FamilyID=08e52ac2-1d62-45f6-9a4a-4b76a8564a2b&displayLang=en

 

Sql Server 2008

Tips, .Net , ,

Welcome to BlogEngine.NET 1.6.0

23. gennaio 2010

If you see this post it means that BlogEngine.NET 1.6.0 is running and the hard part of creating your own blog is done. There is only a few things left to do.

Write Permissions

To be able to log in to the blog and writing posts, you need to enable write permissions on the App_Data folder. If you’re blog is hosted at a hosting provider, you can either log into your account’s admin page or call the support. You need write permissions on the App_Data folder because all posts, comments, and blog attachments are saved as XML files and placed in the App_Data folder. 

If you wish to use a database to to store your blog data, we still encourage you to enable this write access for an images you may wish to store for your blog posts.  If you are interested in using Microsoft SQL Server, MySQL, VistaDB, or other databases, please see the BlogEngine wiki to get started.

Security

When you've got write permissions to the App_Data folder, you need to change the username and password. Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change the username and password.  Passwords are hashed by default so if you lose your password, please see the BlogEngine wiki for information on recovery.

Configuration and Profile

Now that you have your blog secured, take a look through the settings and give your new blog a title.  BlogEngine.NET 1.4 is set up to take full advantage of of many semantic formats and technologies such as FOAF, SIOC and APML. It means that the content stored in your BlogEngine.NET installation will be fully portable and auto-discoverable.  Be sure to fill in your author profile to take better advantage of this.

Themes and Widgets

One last thing to consider is customizing the look of your blog.  We have a few themes available right out of the box including two fully setup to use our new widget framework.  The widget framework allows drop and drag placement on your side bar as well as editing and configuration right in the widget while you are logged in.  Be sure to check out our home page for more theme choices and downloadable widgets to add to your blog.

On the web

You can find BlogEngine.NET on the official website. Here you'll find tutorials, documentation, tips and tricks and much more. The ongoing development of BlogEngine.NET can be followed at CodePlex where the daily builds will be published for anyone to download.

Good luck and happy writing.

The BlogEngine.NET team

,

Il 12-04-2010 è il giorno del lancio di Visual Studio 2010 e .NET Framework 4

14. gennaio 2010

Dal blog di Rob Caron su MSDN Blogs :

Short but sweet, Visual Studio 2010 and .NET Framework 4 will launch on Monday, 12 April 2010.

asp.net ,

Security Starter Kit 2010 : I migliori software di protezione free secondo CNet

12. gennaio 2010