Tags: | Posted by AlexanderZeitler on 10/21/2008 12:51 PM | Comments (0)

Infos in Form von Links zu Blogs, Artikeln, Büchern usw. zu ASP.NET MVC finden sich unter http://aspdotnetmvc.com/

ASP.NET MVC

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: , , | Posted by AlexanderZeitler on 10/16/2008 7:53 PM | Comments (4)

Seit heute sind die Blogposts von DotNetGerman.com auch bei twitter verfügbar.

DotNetGerman Bloggers bei twitter

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: , , | Posted by AlexanderZeitler on 10/11/2008 5:31 PM | Comments (2)

Um für Unit-Tests eine Test-Datenbank mit definierten Werten mittels SMO in .NET erzeugen und nach dem Test rückstandsfrei wieder löschen zu können, ist folgender Code nötig:

using System;
using System.IO;
using Microsoft.SqlServer.Management.Smo;
using NUnit.Framework;
using TestApplication.Domain.Repositories;
namespace TestApplication.Repository.Tests {
    [TestFixture]
    public class ICustomerRepositoryTests {
        [SetUp]
        public void Init() {
            // Connect to SQL-Server instance
            Server server = new Server(@"(local)\SQLEXPRESS");
            // Create new database
            Database db = new Database(server, "TestDatabase");
            db.Collation = "Latin1_General_CI_AS";
            db.Create();
            
            // Create Tables and Data by SQL-Scripts
            string projectPath =
                @"C:\Dev\TestApplication\trunk\src\TestApplication\TestApplication.Repository.Tests\SqlScripts";
            string[] scriptFilenames = new[] {
                "Customer_Table", 
                "Customer_Data", 
                "Supplier_Table", 
                "Supplier_Data"};
            foreach (string scriptFilename in scriptFilenames) {
                FileInfo scriptFile = new FileInfo(projectPath + "\\" + scriptFilename + ".sql");
                string script = scriptFile.OpenText().ReadToEnd();
                server.ConnectionContext.ExecuteNonQuery(script);
            }
            // Close SQL-Server connection
            server.ConnectionContext.Disconnect();
        }
        [TearDown]
        public void Dispose() {
            // Connect to SQL-Server instance
            Server server = new Server(@"(local)\SQLEXPRESS");
            // Connect to Database and refresh its state
            Database db = new Database(server, "TestDatabase");
            db.Refresh();
            // Delete database and close SQL-Server connection
            db.Drop();
            server.ConnectionContext.Disconnect();
        }
    }
}

 

Außerdem müssen Referenzen auf folgende Assemblies vorhanden sein:

  • Microsoft.SqlServer.ConnectionInfo
  • Microsoft.SqlServer.Smo
  • Microsoft.SqlServer.SmoEnum
  • Microsoft.SqlServer.SqlEnum

Bei den .sql Files handelt es sich um normale SQL-Scripts für Create Table und Insert für die Daten.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: , | Posted by AlexanderZeitler on 10/3/2008 5:23 PM | Comments (1)

Die Suche nach “ASP.NET MVC Preview 6” lieferte soeben folgendes Resultat:

googlesorry

Alles klar.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5