<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Biggle&#039;s Blog &#187; .NET</title>
	<atom:link href="http://www.biggle.de/blog/tag/net/feed" rel="self" type="application/rss+xml" />
	<link>http://www.biggle.de/blog</link>
	<description>Web- und Software Development</description>
	<lastBuildDate>Thu, 26 Jan 2012 12:26:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>BASTA! on Tour – Architecture &amp; Best Practices + Gewinnspiel</title>
		<link>http://www.biggle.de/blog/basta-on-tour-%e2%80%93-architecture-best-practices-gewinnspiel</link>
		<comments>http://www.biggle.de/blog/basta-on-tour-%e2%80%93-architecture-best-practices-gewinnspiel#comments</comments>
		<pubDate>Wed, 20 Apr 2011 11:58:25 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=6353</guid>
		<description><![CDATA[Vom 19. bis 20. Mai 2011 veranstaltet die Entwickler Akademie in Kooperation mit dem dot.net Magazin die nächste BASTA! on Tour &#8211; Architecture &#038; Best Practices – diesmal in Düsseldorf. Das Tochterevent der BASTA! – der größten unabhängigen .NET-Konferenz bietet zwei Tage lang tiefgehendes Know-how zum Thema Architektur und Best Practices in der .NET-Welt. Insgesamt [...]]]></description>
			<content:encoded><![CDATA[<p>Vom 19. bis 20. Mai 2011 veranstaltet die Entwickler Akademie in Kooperation mit dem dot.net Magazin die nächste BASTA! on Tour &#8211; Architecture &#038; Best Practices – diesmal in Düsseldorf. Das Tochterevent der BASTA! – der größten unabhängigen .NET-Konferenz bietet zwei Tage lang tiefgehendes Know-how zum Thema Architektur und Best Practices in der .NET-Welt. </p>
<p>Insgesamt vier ganztägige Workshops, acht Sessions und ein Speaker Panel mit den bekannten .NET-Experten Dr. Holger Schwichtenberg, Jörg Neumann, Manfred Steyer und Christian Wenz stehen zur Auswahl. </p>
<p>Das Trainingsevent vermittelt am ersten Tag die Grundlagen von WPF, WCF, Entity Framework und jQuery. Der zweite Tag baut auf den Inhalten der Workshops auf und steht ganz im Zeichen von Architekturfragen, Patterns, Tipps, Tricks und Best Practices.</p>
<p>Alle Infos auf <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iYXN0YS1vbi10b3VyLmRl">www.basta-on-tour.de</a></p>
<p><img alt="" src="http://www.biggle.de/images/BOT_430x70_statisch.gif" class="alignnone" width="430" height="70" /></p>
<h2>Gewinnspiel</h2>
<p>Warst Du schon einmal auf der Basta, Basta Spring oder Basta on Tour? Wenn ja, wie sind Deine Erfahrungen, würdest du wieder hingehen, oder jemand anderes empfehlen?</p>
<p>Unter den Kommentaren, verlose ich zusammen mit der Entwickler Akademie ein <strong>Abonnement für 1 Jahr für das <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5kb3RuZXQtbWFnYXppbi5kZS8=">dotnet Magazin</a></strong>. </p>
<p>Der Gewinner wird über <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5yYW5kb20ub3JnLw==">random.org</a> ermittelt. Das Gewinnspiel endet zum 30.April 2011 20Uhr.</p>
<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=6353" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>7. Februar 2011 -- <a href="http://www.biggle.de/blog/sqlite-datenbanken-in-csharp-applikationen-verwenden" title="SQLite Datenbanken in C# Applikationen verwenden">SQLite Datenbanken in C# Applikationen verwenden</a></li><li>9. Januar 2011 -- <a href="http://www.biggle.de/blog/mehrfachvererbung-ein-beispiel-in-c" title="Mehrfachvererbung – Ein Beispiel in C#">Mehrfachvererbung – Ein Beispiel in C#</a></li><li>3. Dezember 2010 -- <a href="http://www.biggle.de/blog/biggle-ist-kein-palindrom" title="Biggle ist kein Palindrom">Biggle ist kein Palindrom</a></li><li>13. Februar 2010 -- <a href="http://www.biggle.de/blog/dotnet-kick-button-in-wordpress-einbinden-ii" title="Dotnet-Kick Button in Wordpress einbinden II">Dotnet-Kick Button in Wordpress einbinden II</a></li><li>25. Januar 2010 -- <a href="http://www.biggle.de/blog/entity-framework-model-updaten" title="Entity Framework Model updaten &#8230;">Entity Framework Model updaten &#8230;</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/basta-on-tour-%e2%80%93-architecture-best-practices-gewinnspiel/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SQLite Datenbanken in C# Applikationen verwenden</title>
		<link>http://www.biggle.de/blog/sqlite-datenbanken-in-csharp-applikationen-verwenden</link>
		<comments>http://www.biggle.de/blog/sqlite-datenbanken-in-csharp-applikationen-verwenden#comments</comments>
		<pubDate>Mon, 07 Feb 2011 20:12:11 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[CSharp]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SQlite]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=6168</guid>
		<description><![CDATA[System.Data.SQlite aus dem Hause phxsoftware bietet eine Schnittstelle zur Verwendung von portablen Datenbanken im SQLite Format. Im Folgenden möchte ich zeigen, wie man diese auf unterschiedlicher Weise, in C# Applikationen verwenden kann. Um eine SQLite Datenbank zu erstellen, gibt es eine Menge von Managementapplikationen oder auch Browsererweiterungen, z.b für den Firefox. Ich verwende, um mir erstmalig [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NxbGl0ZS5waHhzb2Z0d2FyZS5jb20v">System.Data.SQlite</a> aus dem Hause phxsoftware bietet eine Schnittstelle zur Verwendung von portablen Datenbanken im <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zcWxpdGUub3JnLw=="><strong>SQLite</strong></a> Format. Im Folgenden möchte ich zeigen, wie man diese auf unterschiedlicher Weise, in <strong>C#</strong> Applikationen verwenden kann.</p>
<p>Um eine <strong>SQLite Datenbank zu erstellen</strong>, gibt es eine Menge von Managementapplikationen oder auch Browsererweiterungen, z.b für den <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cHM6Ly9hZGRvbnMubW96aWxsYS5vcmcvZW4tVVMvZmlyZWZveC9hZGRvbi9zcWxpdGUtbWFuYWdlci8=">Firefox</a>. Ich verwende, um mir erstmalig eine Datenbank zu erstellen, den kostenlosen <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NxbGl0ZWJyb3dzZXIuc291cmNlZm9yZ2UubmV0Lw==">SQLiteBrowser</a>. Die erstellte Datenbank speichere ich dann in meinem TestProjekt, mit welchem ich auf diese zugreifen möchte.</p>
<p>Als erstes holen wir uns die Installation oder die <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NvdXJjZWZvcmdlLm5ldC9wcm9qZWN0cy9zcWxpdGUtZG90bmV0Mi9maWxlcy9TUUxpdGUlMjBmb3IlMjBBRE8uTkVUJTIwMi4wLzEuMC42Ni4wLw==">Binaries</a>. Je nach Architektur wird dann im Projekt, auf die entsprechende dll referenziert. Ich verwende die System.Data.SQLite.dll für x86, welche sich im <strong>bin </strong>Ordner befindet.</p>
<h2>SQLiteCommand</h2>
<p>Im ersten Beispiel, verwende ich die SQLiteCommand-Klasse, um auf die Datenbank zugreifen.</p>
<p>Nach dem Einbinden des Namespace &#8220;<strong>using System.Data.SQLite;</strong>&#8221; stehen uns die Klassen <strong>SQLiteConnection </strong>und <strong>SQLiteCommand </strong>zur Verfügung. (Mehr benötigen wir erstmal in unserem Beispiel nicht.)</p>
<p>Den Pfad, zur zuvor angelegten Datenbank lege ich in der app.config fest, damit dieser konfigurierbar bleibt:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>configuration<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>appSettings<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>add <span style="color: #990000;">key</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;DATASOURCE&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;../../DataBase/data&quot;</span> <span style="color: #339933;">/&gt;</span>
  <span style="color: #339933;">&lt;/</span>appSettings<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>configuration<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>im Code dann (namens DataProvider.cs), holen wir uns den Pfad über den ConfigurationManager in eine KlassenVariable. Hier muss explizit auf <em>System.Configuration</em> referenziert werden</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> string DataSource <span style="color: #339933;">=</span> ConfigurationManager<span style="color: #339933;">.</span>AppSettings<span style="color: #339933;">.</span>Get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;DATASOURCE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Das Speichern, Emitteln und Löschen erledigen wir über das SQLiteCommand. Zum Öffnen und Schließen der SQLiteConnection habe ich mir zwei Methoden geschrieben:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">SQLiteConnection connection<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> void OpenConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    connection <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SQLiteConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    connection<span style="color: #339933;">.</span>ConnectionString <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Data Source=&quot;</span> <span style="color: #339933;">+</span> DataSource<span style="color: #339933;">;</span>
    connection<span style="color: #339933;">.</span>Open<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> void CloseConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    connection<span style="color: #339933;">.</span>Close<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    connection<span style="color: #339933;">.</span>Dispose<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><span style="text-decoration: underline;">Speichern von Einträgen</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">OpenConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
using <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> command <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SQLiteCommand<span style="color: #009900;">&#40;</span>connection<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    command<span style="color: #339933;">.</span>CommandText <span style="color: #339933;">=</span> string<span style="color: #339933;">.</span>Format<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;INSERT INTO Entities (Beschreibung, HtmlName, Unicode, Zeichen) VALUES('{0}', '{1}', '{2}', '{3}')&quot;</span><span style="color: #339933;">,</span>
                    entity<span style="color: #339933;">.</span>Beschreibung<span style="color: #339933;">,</span> entity<span style="color: #339933;">.</span>HtmlName<span style="color: #339933;">,</span> entity<span style="color: #339933;">.</span>Unicode<span style="color: #339933;">,</span> entity<span style="color: #339933;">.</span>Zeichen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    command<span style="color: #339933;">.</span>ExecuteNonQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
CloseConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><span style="text-decoration: underline;">Ermitteln von Einträgen</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">OpenConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
List<span style="color: #339933;">&lt;</span>HtmlEntity<span style="color: #339933;">&gt;</span> entities <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> List<span style="color: #339933;">&lt;</span>HtmlEntity<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
using <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> command <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SQLiteCommand<span style="color: #009900;">&#40;</span>connection<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    command<span style="color: #339933;">.</span>CommandText <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM Entities&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    using <span style="color: #009900;">&#40;</span>SQLiteDataReader reader <span style="color: #339933;">=</span> command<span style="color: #339933;">.</span>ExecuteReader<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>reader<span style="color: #339933;">.</span>Read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            entities<span style="color: #339933;">.</span>Add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> HtmlEntity
            <span style="color: #009900;">&#123;</span>
                Beschreibung <span style="color: #339933;">=</span> reader<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>ToString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                HtmlName <span style="color: #339933;">=</span> reader<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>ToString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                Unicode <span style="color: #339933;">=</span> reader<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>ToString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                Zeichen <span style="color: #339933;">=</span> reader<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>ToString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        reader<span style="color: #339933;">.</span>Close<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
CloseConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><span style="text-decoration: underline;">Löschen von Einträgen</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">OpenConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
using <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> command <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SQLiteCommand<span style="color: #009900;">&#40;</span>connection<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    command<span style="color: #339933;">.</span>CommandText <span style="color: #339933;">=</span> string<span style="color: #339933;">.</span>Format<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;DELETE FROM Entities WHERE Beschreibung = '{0}' AND HtmlName = '{1}' AND Unicode = '{2}' AND Zeichen =  '{3}'&quot;</span><span style="color: #339933;">,</span>
        entity<span style="color: #339933;">.</span>Beschreibung<span style="color: #339933;">,</span> entity<span style="color: #339933;">.</span>HtmlName<span style="color: #339933;">,</span> entity<span style="color: #339933;">.</span>Unicode<span style="color: #339933;">,</span> entity<span style="color: #339933;">.</span>Zeichen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    command<span style="color: #339933;">.</span>ExecuteNonQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
CloseConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Achtung!</strong> Es ist möglich, das die SQLite Assembly sich nicht mit dem 4.0 .NET  kompilieren lässt. (<em>Mixed mode assembly is built against version &#8216;v2.0.50727&#8242; of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information</em>), hier kann man sich aber mit folgendem Eintrag, innerhalb des &#8220;configuration-Knoten&#8221; in der app.config behelfen</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>startup useLegacyV2RuntimeActivationPolicy<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>supportedRuntime version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;v4.0&quot;</span><span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>startup<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Tipp via: <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL3F1ZXN0aW9ucy8yNjA1NDkwL3N5c3RlbS1kYXRhLXNxbGl0ZS1uZXQtNA==">stackoverflow</a></p>
<p><br class="spacer_" /></p>
<h2>SQLite &amp; Entity Framework</h2>
<p>Es ist auch möglich, eine SQLite Datenbank als Datensource für ein Entity-Framework-Model anzugeben. Das erstelle Entity FrameworkModel stellt uns nun den Kontext bereit, Einträge zu persistieren, zu ermitteln und zu löschen.</p>
<p>Eintrag speichern</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> void  InsertData<span style="color: #009900;">&#40;</span>HtmlEntity entity<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    using <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> context <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HtmlEntityEntities<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        context<span style="color: #339933;">.</span>AddToEntities<span style="color: #009900;">&#40;</span>entity<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        context<span style="color: #339933;">.</span>SaveChanges<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Einträge ermitteln</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&lt;</span>HtmlEntity<span style="color: #339933;">&gt;</span> GetAllHtmlEntities<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    List<span style="color: #339933;">&lt;</span>HtmlEntity<span style="color: #339933;">&gt;</span> entities<span style="color: #339933;">;</span>
&nbsp;
    using <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> context <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HtmlEntityEntities<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        entities <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>from e in context<span style="color: #339933;">.</span>Entities
                    select e<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>ToList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>         
&nbsp;
    <span style="color: #b1b100;">return</span> entities<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Eintrag löschen</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> void DeleteData<span style="color: #009900;">&#40;</span>HtmlEntity entity<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    using <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> context <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HtmlEntityEntities<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        HtmlEntity obj <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>HtmlEntity<span style="color: #009900;">&#41;</span>context<span style="color: #339933;">.</span>GetObjectByKey<span style="color: #009900;">&#40;</span>entity<span style="color: #339933;">.</span>EntityKey<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
        context<span style="color: #339933;">.</span>DeleteObject<span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        context<span style="color: #339933;">.</span>SaveChanges<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h2>LINQ to SQLite</h2>
<p>Wie wir an den EF Methoden gesehen haben, können wir nun einfach mit LINQ die Operationen ausführen.</p>
<p>Am Beispiel &#8220;Einträge ermitteln&#8221; wurde LINQ bereits verwendet, diese kann dann natürlich auch durch eine Where-Klausel erweitert werden:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">using <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> context <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HtmlEntityEntities<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>  
    <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span>from e in context<span style="color: #339933;">.</span>Entities                        
            where e<span style="color: #339933;">.</span>Beschreibung <span style="color: #339933;">==</span> keyword                      
            select e<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>FirstOrDefault<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Auch wenn es so scheint, dass die System.Data.SQLite.Linq.dll wichtig für den Zugriff mit LINQ ist, wir benötigen diese dll nicht, denn durch das generieren des EF Models, steht uns hier LINQ aus dem Framework zu Verfügung.</p>
<p>Fragen? Einfach in den Kommentaren damit. Viel Spaß beim entwickeln : )</p>
<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=6168" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>9. Januar 2011 -- <a href="http://www.biggle.de/blog/mehrfachvererbung-ein-beispiel-in-c" title="Mehrfachvererbung – Ein Beispiel in C#">Mehrfachvererbung – Ein Beispiel in C#</a></li><li>22. Januar 2010 -- <a href="http://www.biggle.de/blog/praktische-muster-commands" title="Praktische Muster &#8211; Commands">Praktische Muster &#8211; Commands</a></li><li>17. Januar 2010 -- <a href="http://www.biggle.de/blog/attribute-mittels-reflektion-abfragen" title="Attribute mittels Reflektion abfragen">Attribute mittels Reflektion abfragen</a></li><li>4. Januar 2010 -- <a href="http://www.biggle.de/blog/webservices-auf-erreichbarkeit-pruefen" title="Webservices auf Erreichbarkeit prüfen">Webservices auf Erreichbarkeit prüfen</a></li><li>5. November 2009 -- <a href="http://www.biggle.de/blog/geschwindigkeitsvorteile-mit-vorkompilierten-linq-queries" title="Geschwindigkeitsvorteile mit vorkompilierten LINQ-Queries">Geschwindigkeitsvorteile mit vorkompilierten LINQ-Queries</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/sqlite-datenbanken-in-csharp-applikationen-verwenden/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Mehrfachvererbung – Ein Beispiel in C#</title>
		<link>http://www.biggle.de/blog/mehrfachvererbung-ein-beispiel-in-c</link>
		<comments>http://www.biggle.de/blog/mehrfachvererbung-ein-beispiel-in-c#comments</comments>
		<pubDate>Sun, 09 Jan 2011 14:49:46 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[CSharp]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=6069</guid>
		<description><![CDATA[Angestichelt durch Ilker sein Blogpost, bin ich der Sache mit der Mehrfachvererbung unter .NET mal etwas auf den Grund gegangen. Der Ansatz mit Mixin, Interfaces und ExtensionMethods scheint ja schon seit .NET 3.0 zu bestehen und scheint mir bisher auch der Beste zu sein. Einen weiteren schönen Artikel kann man bei Galileo Computing lesen. Hier ein Beispiel [...]]]></description>
			<content:encoded><![CDATA[<p>Angestichelt durch <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2lsa2VyLmRlL21laHJmYWNodmVyZXJidW5nLWluLWM=">Ilker sein Blogpost</a>, bin ich der Sache mit der <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlLndpa2lwZWRpYS5vcmcvd2lraS9NZWhyZmFjaHZlcmVyYnVuZw==">Mehrfachvererbung</a> unter .NET mal etwas auf den Grund gegangen. Der Ansatz mit <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9NaXhpbg==">Mixin</a>, Interfaces und ExtensionMethods scheint ja schon seit .NET 3.0 zu bestehen und scheint mir bisher auch der Beste zu sein. Einen weiteren schönen Artikel kann man bei <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL29wZW5ib29rLmdhbGlsZW9jb21wdXRpbmcuZGUvb29wL29vcF9rYXBpdGVsXzA1XzAwNC5odG0jbWo0NzQ0YTgwYWMwZmY1MjAxNjdkMDEyNGQ3M2RiYTJiMg==">Galileo Computing</a> lesen.</p>
<p>Hier ein Beispiel wie ich das verstanden habe und umsetzen würde.</p>
<p>Interfaces</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> IMixinDateTime
<span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> IMixinOneMoreInterface
<span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>ExtensionMethods</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">class</span> MixinExtensionMethods
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> static int GetYearDiff<span style="color: #009900;">&#40;</span>this IMixinDateTime mxDateMethod<span style="color: #339933;">,</span> DateTime dateTime<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span>DateTime<span style="color: #339933;">.</span>Now<span style="color: #339933;">.</span>Subtract<span style="color: #009900;">&#40;</span>dateTime<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>Ticks<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>Year <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> static void OneMoreMethod<span style="color: #009900;">&#40;</span>this IMixinOneMoreInterface mxOneMoreMethod<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//implement method here ...</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Klassen, welche die Interfaces erben (ggf. implementieren)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Car <span style="color: #339933;">:</span> IMixinDateTime
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> DateTime Baujahr <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Person <span style="color: #339933;">:</span> IMixinDateTime<span style="color: #339933;">,</span> IMixinOneMoreInterface
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> DateTime Birthday <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Verwendung</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">Person person <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Person<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
person<span style="color: #339933;">.</span>Birthday <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1973</span><span style="color: #339933;">,</span> <span style="color: #208080;">01</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">23</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> personAge <span style="color: #339933;">=</span> person<span style="color: #339933;">.</span>GetYearDiff<span style="color: #009900;">&#40;</span>person<span style="color: #339933;">.</span>Birthday<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Car car <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Car<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
car<span style="color: #339933;">.</span>Baujahr <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2000</span><span style="color: #339933;">,</span> <span style="color: #208080;">01</span><span style="color: #339933;">,</span> <span style="color: #208080;">01</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> carAge <span style="color: #339933;">=</span> car<span style="color: #339933;">.</span>GetYearDiff<span style="color: #009900;">&#40;</span>car<span style="color: #339933;">.</span>Baujahr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
person<span style="color: #339933;">.</span>OneMoreMethod<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Da beliebig viele Interfaces geerbt werden können, erschließt sich hier, wie das Prinzip funktioniert. Weitere Meinungen, Ergänzungen oder Ansätze sind gerne als Kommentar gesehen.</p>
<p>Viel Spaß beim entwickeln : )</p>
<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=6069" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>7. Februar 2011 -- <a href="http://www.biggle.de/blog/sqlite-datenbanken-in-csharp-applikationen-verwenden" title="SQLite Datenbanken in C# Applikationen verwenden">SQLite Datenbanken in C# Applikationen verwenden</a></li><li>3. Dezember 2010 -- <a href="http://www.biggle.de/blog/biggle-ist-kein-palindrom" title="Biggle ist kein Palindrom">Biggle ist kein Palindrom</a></li><li>22. Januar 2010 -- <a href="http://www.biggle.de/blog/praktische-muster-commands" title="Praktische Muster &#8211; Commands">Praktische Muster &#8211; Commands</a></li><li>17. Januar 2010 -- <a href="http://www.biggle.de/blog/attribute-mittels-reflektion-abfragen" title="Attribute mittels Reflektion abfragen">Attribute mittels Reflektion abfragen</a></li><li>4. Januar 2010 -- <a href="http://www.biggle.de/blog/webservices-auf-erreichbarkeit-pruefen" title="Webservices auf Erreichbarkeit prüfen">Webservices auf Erreichbarkeit prüfen</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/mehrfachvererbung-ein-beispiel-in-c/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Biggle ist kein Palindrom</title>
		<link>http://www.biggle.de/blog/biggle-ist-kein-palindrom</link>
		<comments>http://www.biggle.de/blog/biggle-ist-kein-palindrom#comments</comments>
		<pubDate>Fri, 03 Dec 2010 10:44:32 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[CSharp]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=6044</guid>
		<description><![CDATA[Eine kleine Übungsaufgabe für mich, die es zu lösen gab. Es sollte heraus gefunden werden, ob es sich bei einem String um ein Palindrom handelt. Mein Lösungsansatz lautet wie folgt: Ich befreie zunächst die Buchstaben von Sonder- und Leerzeichen und konvertiere alle Zeichen zu Kleinbuchstaben. Dann durchlaufe ich eine for-Schleife mit eine Länge des Stringparameters. [...]]]></description>
			<content:encoded><![CDATA[<p>Eine kleine Übungsaufgabe für mich, die es zu lösen gab. Es sollte heraus gefunden werden, ob es sich bei einem String um ein <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlLndpa2lwZWRpYS5vcmcvd2lraS9QYWxpbmRyb20=">Palindrom</a> handelt.</p>
<p>Mein Lösungsansatz lautet wie folgt:<br />
 Ich befreie zunächst die Buchstaben von Sonder- und Leerzeichen und konvertiere alle Zeichen zu Kleinbuchstaben. Dann durchlaufe ich eine for-Schleife mit eine Länge des Stringparameters.</p>
<p>Ich zerlege den String in ein CharArray und vergleiche innerhalb der Schleife, den vorderen mit den letzten Buchstaben. Sind diese gleich wird der nächste vordere und der nächste hintere Buchstabe verglichen. Das geht so lange bis diese sich in der Mitte treffen.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">class</span> ExtensionMethods
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> static bool IsPalindrome<span style="color: #009900;">&#40;</span>this string value<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//von Leer- und Sonderzeichen befreien</span>
        value <span style="color: #339933;">=</span> value<span style="color: #339933;">.</span>ToLower<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>RemoveSpecialCharacters<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        int minValue <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        int maxValue <span style="color: #339933;">=</span> value<span style="color: #339933;">.</span>Length <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">var</span> charArray <span style="color: #339933;">=</span> value<span style="color: #339933;">.</span>ToCharArray<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>int i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> value<span style="color: #339933;">.</span>Length <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>charArray<span style="color: #009900;">&#91;</span>minValue<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> charArray<span style="color: #009900;">&#91;</span>maxValue<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                minValue<span style="color: #339933;">++;</span>
                maxValue<span style="color: #339933;">--;</span>
                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">else</span>
                <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> static string RemoveSpecialCharacters<span style="color: #009900;">&#40;</span>this string value<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> Regex<span style="color: #339933;">.</span>Replace<span style="color: #009900;">&#40;</span>value<span style="color: #339933;">,</span> <span style="color: #339933;">@</span><span style="color: #0000ff;">&quot;[^a-zA-Z0-9]&quot;</span><span style="color: #339933;">,</span> string<span style="color: #339933;">.</span><span style="color: #990000;">Empty</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Verwendung:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Program
<span style="color: #009900;">&#123;</span>
    static void Main<span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        PalindromFactory factory <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PalindromFactory<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> palindrome <span style="color: #339933;">=</span> factory<span style="color: #339933;">.</span>GetPalindrome<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        string output <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;{0} ist {1}ein Palindrom&quot;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> palindrom in palindrome<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            Console<span style="color: #339933;">.</span>WriteLine<span style="color: #009900;">&#40;</span>String<span style="color: #339933;">.</span>Format<span style="color: #009900;">&#40;</span>output<span style="color: #339933;">,</span> palindrom<span style="color: #339933;">,</span> palindrom<span style="color: #339933;">.</span>IsPalindrome<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;k&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">var</span> palindromSaetze <span style="color: #339933;">=</span> factory<span style="color: #339933;">.</span>GetPalindromSaetze<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> palindrom in palindromSaetze<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            Console<span style="color: #339933;">.</span>WriteLine<span style="color: #009900;">&#40;</span>String<span style="color: #339933;">.</span>Format<span style="color: #009900;">&#40;</span>output<span style="color: #339933;">,</span> palindrom<span style="color: #339933;">,</span> palindrom<span style="color: #339933;">.</span>IsPalindrome<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;k&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Ich hoffe ich habe nichts vergessen, getestet jedoch habe ich diese Methode mit der <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RlLndpa2lwZWRpYS5vcmcvd2lraS9MaXN0ZV9kZXV0c2NoZXJfUGFsaW5kcm9tZQ==">Liste deutscher Palindrome</a> aus Wikipedia. Nicht-Palindrome natürlich mit einbegriffen : )</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/// Stellt eine Sammlung von Palindrome und Palindromsätze bereit</span>
<span style="color: #666666; font-style: italic;">/// Quelle Wikipedia</span>
<span style="color: #666666; font-style: italic;">/// http://de.wikipedia.org/wiki/Liste_deutscher_Palindrome</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PalindromFactory
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> List<span style="color: #339933;">&lt;</span>string<span style="color: #339933;">&gt;</span> Palindrome <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&lt;</span>string<span style="color: #339933;">&gt;</span> GetPalindrome<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        Palindrome <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> List<span style="color: #339933;">&lt;</span>string<span style="color: #339933;">&gt;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">&quot;Aha&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Amokoma&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Amoralaroma&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Anina&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Anna&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Annasusanna&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Aua&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Bob&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Bub&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Burggrub&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Biggle&quot;</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//kein Palindrom</span>
            <span style="color: #0000ff;">&quot;Mario&quot;</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//kein Palindrom</span>
            <span style="color: #0000ff;">&quot;Mongognom&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Nebelleben&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;neben&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Neffen&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;nennen&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;netten&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;netzten&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Neozoen&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;nun&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Omo&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Otto&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Priebe&quot;</span> <span style="color: #666666; font-style: italic;">//kein Palindrom</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> Palindrome<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&lt;</span>string<span style="color: #339933;">&gt;</span> GetPalindromSaetze<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        Palindrome <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> List<span style="color: #339933;">&lt;</span>string<span style="color: #339933;">&gt;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">&quot;Die Liebe fleht: Helfe bei Leid!&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Die Liebe geht, hege Beileid!&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Die Liebe, ist sie Beileid?&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Die Liebe ist Sieger, rege ist sie bei Leid.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Die Liebe ist Sieger, stets rege ist sie bei Leid.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Die Niere bot Komik: nass sank im Oktober ein Eid.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Die Rede — ist sie der Eid?&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Dreh Magiezettel um, Amulette zeig am Herd!&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Du, erfror Freud?&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Der Fred&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Eine güldne, gute Tugend: Lüge nie!&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Eine Horde bedrohe nie!&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Eine Hure ruhe nie.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Eine Note betone nie.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Eine so Kesse kose nie.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Eine treue Familie bei Lima feuerte nie.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Einhorn roh? Nie!&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Eins nutzt uns: Amore. Die Rederei da, die Rederei der Omas nutzt uns nie.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Eis feil! Ei, wo Eis feil lief sie, o wie lief sie.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Elietta hat Teile.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Ella rüffelte Detlef für alle.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Elly biss Sibylle.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Emma, behend 'ne Hebamme!&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Emma, so litt Tilos Amme!&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Emmas Amme&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Er habe nie eine Bahre.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Erhabene Bahre&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Erhöre nie eine Röhre.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Erika feuert nur untreue Fakire.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Erol, red nie in der Lore.&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">&quot;Alles hat seine Zeit, nur die alten Weiber nicht.&quot;</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//Kein Palindromsatz</span>
            <span style="color: #0000ff;">&quot;Es eilt, immer ahnend Nebel, reger der Flegel Fred, reg' erlebend nen Harem mit Liese.&quot;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> Palindrome<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Für einen schnellen Verwendungszeck (<strong>weil man das auch so oft braucht oO</strong>)  habe ich das ganze als ExtensionMethod implementiert.</p>
<p>Wie schaut&#8217;s aus, hast du Verbesserungsvorschläge? Würdest du es anders machen, wenn ja wie? Du kannst im Kommentarfeld mit [code]<strong>var* </strong>deinCodeSnippet = 0;[/code] posten.</p>
<p><br class="spacer_" /></p>
<p>Viel Spaß beim entwickeln : )</p>
<p><br class="spacer_" /></p>
<p>* = <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21lbnR6ZWwubmFtZS8yMDEwLzEyLzAyL3ZhcnVtLw==">Var oder nicht var&#8230;</a></p>
<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=6044" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>9. Januar 2011 -- <a href="http://www.biggle.de/blog/mehrfachvererbung-ein-beispiel-in-c" title="Mehrfachvererbung – Ein Beispiel in C#">Mehrfachvererbung – Ein Beispiel in C#</a></li><li>18. November 2009 -- <a href="http://www.biggle.de/blog/php-entwicklungsumgebung-auf-windows" title="PHP Entwicklungsumgebung unter Windows">PHP Entwicklungsumgebung unter Windows</a></li><li>20. April 2011 -- <a href="http://www.biggle.de/blog/basta-on-tour-%e2%80%93-architecture-best-practices-gewinnspiel" title="BASTA! on Tour – Architecture &#038; Best Practices + Gewinnspiel">BASTA! on Tour – Architecture &#038; Best Practices + Gewinnspiel</a></li><li>7. Februar 2011 -- <a href="http://www.biggle.de/blog/sqlite-datenbanken-in-csharp-applikationen-verwenden" title="SQLite Datenbanken in C# Applikationen verwenden">SQLite Datenbanken in C# Applikationen verwenden</a></li><li>7. Februar 2011 -- <a href="http://www.biggle.de/blog/c-programmieren-fuer-anfaenger" title="C Programmieren für Anfänger">C Programmieren für Anfänger</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/biggle-ist-kein-palindrom/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dotnet-Kick Button in WordPress einbinden II</title>
		<link>http://www.biggle.de/blog/dotnet-kick-button-in-wordpress-einbinden-ii</link>
		<comments>http://www.biggle.de/blog/dotnet-kick-button-in-wordpress-einbinden-ii#comments</comments>
		<pubDate>Sat, 13 Feb 2010 09:29:35 +0000</pubDate>
		<dc:creator>Mario Priebe</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tipps]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.biggle.de/blog/?p=3870</guid>
		<description><![CDATA[Stefan Lieser hat zwar schon einmal ein CodeSnippet veröffentlicht, wie man den Dotnet-Kick Button in einem WordPress Blog einbindet, ich hab dieses kleine Snippet aber noch ein bisschen &#8220;verfeinert&#8221; : ) Es wird nun nicht nur der Link und der Titel des Artikels zu dotnet-kicks mit übertragen, sondern auch ein Teil vom Content, welcher im [...]]]></description>
			<content:encoded><![CDATA[<p>Stefan Lieser hat zwar schon einmal ein CodeSnippet <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5saWVzZXItb25saW5lLmRlL2Jsb2cvP3A9MTYx">veröffentlicht</a>, wie man den Dotnet-Kick Button in einem WordPress Blog einbindet, ich hab dieses kleine Snippet aber noch ein bisschen &#8220;verfeinert&#8221; : ) </p>
<p>Es wird nun nicht nur der Link und der Titel des Artikels zu <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RvdG5ldC1raWNrcy5kZS8=">dotnet-kicks</a> mit übertragen, sondern auch ein Teil vom Content, welcher im Beschreibungsfeld mit vorausgefüllt wird.</p>
<p>Hier kannst Du auch die Anzahl der Zeichen, die von Deinem Content abgeschnitten werden sollen mit angeben (atm im Code 160). Nun einfach nur noch die Kategorie auf dotnet-kick anwählen und speichern.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;http://dotnet-kicks.de/kick/?url=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;title=<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;description=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> get_the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$newString</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">160</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$newString</span><span style="color: #339933;">.=</span> <span style="color: #0000ff;">' ...'</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$newString</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt;img src=&quot;http://dotnet-kicks.de/Services/Images/KickItImageGenerator.ashx?url=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; alt=&quot;Kick it on dotnet-kicks.de&quot; /&gt;&lt;/a&gt;</pre></td></tr></table></div>

<p>Wenn Du den Content nicht abschneiden möchtest, dann benutzt du einfach folgenden Code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;http://dotnet-kicks.de/kick/?url=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;title=<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&amp;description=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> get_the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt;img src=&quot;http://dotnet-kicks.de/Services/Images/KickItImageGenerator.ashx?url=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; alt=&quot;Kick it on dotnet-kicks.de&quot; /&gt;&lt;/a&gt;</pre></td></tr></table></div>

<p>Ich glaub sogar, dass <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuamFuLXdlbGtlci5kZS8=">Jan Welker</a> (Mitinitiator von dotnet-kicks) ein Truncate in der Artikelansicht mit eingebaut hat, also sollte normal das untere Snippet ausreichen&#8230;</p>
<p>Wie auch immer, viel Spass damit</p>
<p>Ich bin auch mal so frech und &#8220;kick&#8221; mich gleich mal selbst :D</p>
<hr /><p style="float:right; font-size:0.9em;">Dieser Beitrag stammt von <a href="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdnbGUuZGU=">Mario Priebe</a>.</p> <img src="http://www.biggle.de/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3870" width="1" height="1" style="display: none;" /><h2  class="related_post_title">Ähnliche Beiträge</h2><ul class="related_post"><li>20. April 2011 -- <a href="http://www.biggle.de/blog/basta-on-tour-%e2%80%93-architecture-best-practices-gewinnspiel" title="BASTA! on Tour – Architecture &#038; Best Practices + Gewinnspiel">BASTA! on Tour – Architecture &#038; Best Practices + Gewinnspiel</a></li><li>7. Februar 2011 -- <a href="http://www.biggle.de/blog/sqlite-datenbanken-in-csharp-applikationen-verwenden" title="SQLite Datenbanken in C# Applikationen verwenden">SQLite Datenbanken in C# Applikationen verwenden</a></li><li>9. Januar 2011 -- <a href="http://www.biggle.de/blog/mehrfachvererbung-ein-beispiel-in-c" title="Mehrfachvererbung – Ein Beispiel in C#">Mehrfachvererbung – Ein Beispiel in C#</a></li><li>3. Dezember 2010 -- <a href="http://www.biggle.de/blog/biggle-ist-kein-palindrom" title="Biggle ist kein Palindrom">Biggle ist kein Palindrom</a></li><li>21. November 2010 -- <a href="http://www.biggle.de/blog/bbcomments-um-syntaxtag-code-erweitert" title="BBComments um SyntaxTag [code] erweitert">BBComments um SyntaxTag [code] erweitert</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.biggle.de/blog/dotnet-kick-button-in-wordpress-einbinden-ii/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

