{"id":81,"date":"2010-11-03T05:36:28","date_gmt":"2010-11-03T12:36:28","guid":{"rendered":"https:\/\/wordpress-1325650-4848760.cloudwaysapps.com\/?p=81"},"modified":"2025-04-29T13:31:09","modified_gmt":"2025-04-29T17:31:09","slug":"c-sharp-desktop-application","status":"publish","type":"post","link":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application","title":{"rendered":"C# Desktop Application With Database: A Step-by-Step Guide"},"content":{"rendered":"\n<p>Ever wanted to create a professional database application without writing mountains of code? I&#8217;ve got you covered. As a developer who&#8217;s built dozens of C# desktop applications over the years, I&#8217;ve discovered that Visual Studio&#8217;s built-in tools make database integration ridiculously easy &#8211; and I&#8217;m going to show you exactly how it&#8217;s done.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why C# Desktop Applications Still Matter<\/h2>\n\n\n\n<p>In today&#8217;s world of web and mobile apps, desktop applications continue to offer significant advantages for certain use cases. C# desktop applications are ideal for businesses requiring robust, responsive software with direct database access, especially when internet connectivity is unreliable or when handling sensitive data locally is preferred.<\/p>\n\n\n\n<p>The .NET platform absolutely dominates when it comes to rapid desktop application development. Microsoft has invested considerable resources in making Visual Studio the premier tool for building Windows applications with minimal effort. This is why enterprise-level software often leverages C# for its mission-critical applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What You&#8217;ll Learn in This Tutorial<\/h2>\n\n\n\n<p>This guide walks you through creating a fully functional database-driven Windows application using C#. We&#8217;ll build a form that lets users navigate through records, add new entries, edit existing ones, and delete data &#8211; all with minimal coding required. You&#8217;ll be amazed at how Visual Studio handles most of the heavy lifting automatically!<\/p>\n\n\n\n<p>Here&#8217;s what we&#8217;ll cover:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Setting up your project correctly from the start<\/li>\n\n\n\n<li>Connecting to SQL Server databases effortlessly<\/li>\n\n\n\n<li>Creating dynamic data-bound forms<\/li>\n\n\n\n<li>Implementing navigation controls<\/li>\n\n\n\n<li>Adding validation and data persistence<\/li>\n\n\n\n<li>Customizing your application for professional results<\/li>\n<\/ul>\n\n\n\n<p>Let&#8217;s dive right in!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before we begin, you should have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Basic understanding of C# syntax<\/li>\n\n\n\n<li>Visual Studio installed (2019 or later version recommended)<\/li>\n\n\n\n<li>Access to Microsoft SQL Server (Express version works perfectly)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Creating Your First C# Database Application<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Set Up Your Project<\/h3>\n\n\n\n<p>First, we need to create a new Windows Forms project:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Launch Visual Studio<\/li>\n\n\n\n<li>Click <strong>File \u2192 New \u2192 Project<\/strong><\/li>\n\n\n\n<li>Select <strong>Windows Forms Application<\/strong> (.NET Framework)<\/li>\n\n\n\n<li>Name your project something meaningful like &#8220;InventoryManager&#8221;<\/li>\n\n\n\n<li>Click <strong>Create<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Visual Studio will generate the basic project structure and open the default form designer. This empty canvas is where we&#8217;ll build our application interface.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Connect to Your Database<\/h3>\n\n\n\n<p>Now let&#8217;s establish the connection to your database:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>From the menu, select <strong>Data \u2192 Add New Data Source<\/strong><\/li>\n\n\n\n<li>Choose <strong>Database<\/strong> as the data source type and click <strong>Next<\/strong><\/li>\n\n\n\n<li>Select <strong>Dataset<\/strong> and click <strong>Next<\/strong><\/li>\n\n\n\n<li>Click <strong>New Connection<\/strong><\/li>\n\n\n\n<li>Select your server type (typically Microsoft SQL Server)<\/li>\n\n\n\n<li>Enter your server name, authentication details, and select your database<\/li>\n\n\n\n<li>Test the connection to ensure everything works<\/li>\n\n\n\n<li>Click <strong>OK<\/strong> and then <strong>Next<\/strong><\/li>\n\n\n\n<li>Save the connection string and click <strong>Next<\/strong><\/li>\n\n\n\n<li>Expand the Tables node and select the tables you want to include<\/li>\n\n\n\n<li>Click <strong>Finish<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Visual Studio automatically generates all the necessary components for database interaction. This includes DataSets, TableAdapters, and connection objects &#8211; saving you hours of manual coding.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Create Your Data-Bound Form<\/h3>\n\n\n\n<p>Here&#8217;s where the magic happens! We&#8217;ll design our form with data-bound controls:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>From <strong>Data \u2192 Show Data Sources<\/strong>, open the Data Sources window<\/li>\n\n\n\n<li>Find your table in the data sources list<\/li>\n\n\n\n<li>Click the dropdown arrow next to your table name and select <strong>Details<\/strong> view<\/li>\n\n\n\n<li>Simply drag your table from the Data Sources window onto your form<\/li>\n<\/ol>\n\n\n\n<p>BAM! Visual Studio automatically creates:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Text boxes for each column<\/li>\n\n\n\n<li>Appropriate labels for each field<\/li>\n\n\n\n<li>A binding navigator control with built-in navigation buttons<\/li>\n\n\n\n<li>All the necessary data binding code is behind the scenes<\/li>\n<\/ul>\n\n\n\n<p>The binding navigator gives users buttons to move through records (previous\/next\/first\/last), add new records, delete existing ones, and more &#8211; without you writing a single line of code!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Customize Your Controls<\/h3>\n\n\n\n<p>Visual Studio assigns default controls based on data types, but you can easily change them:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For <strong>text fields<\/strong> (varchar\/nvarchar): TextBox controls are created<\/li>\n\n\n\n<li>For <strong>boolean values<\/strong>: CheckBox controls are used<\/li>\n\n\n\n<li>For <strong>numeric fields<\/strong>: NumericUpDown controls can be selected<\/li>\n\n\n\n<li>For <strong>date fields<\/strong>: DateTimePicker controls are available<\/li>\n<\/ul>\n\n\n\n<p>To change a control type:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the Data Sources window, click the dropdown arrow next to the field<\/li>\n\n\n\n<li>Select your preferred control type from the list<\/li>\n\n\n\n<li>Drag the field to your form again (or adjust the existing control)<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Enable Data Persistence<\/h3>\n\n\n\n<p>By default, changes made to your form are not automatically saved to the database. Let&#8217;s add that functionality:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add a <strong>Save<\/strong> button to your form (if not already present in the binding navigator)<\/li>\n\n\n\n<li>Double-click the button to create its click event handler<\/li>\n\n\n\n<li>Add the following code:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">private <span class=\"hljs-keyword\">void<\/span> btnSave_Click(object sender, EventArgs e)\n{\n    <span class=\"hljs-comment\">\/\/ Validate data before saving<\/span>\n    <span class=\"hljs-keyword\">this<\/span>.Validate();\n    \n    <span class=\"hljs-comment\">\/\/ Push changes from controls to dataset<\/span>\n    <span class=\"hljs-keyword\">this<\/span>.myBindingSource.EndEdit();\n    \n    <span class=\"hljs-comment\">\/\/ Update database with changes from dataset<\/span>\n    <span class=\"hljs-keyword\">this<\/span>.myTableAdapter.Update(<span class=\"hljs-keyword\">this<\/span>.myDataSet);\n    \n    <span class=\"hljs-comment\">\/\/ Show confirmation<\/span>\n    MessageBox.Show(<span class=\"hljs-string\">\"Data saved successfully!\"<\/span>, <span class=\"hljs-string\">\"Success\"<\/span>, \n                    MessageBoxButtons.OK, MessageBoxIcon.Information);\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This code handles the entire save process:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>First, it validates input values<\/li>\n\n\n\n<li>Then it commits pending changes to the data source<\/li>\n\n\n\n<li>Finally, it pushes those changes to the actual database<\/li>\n\n\n\n<li>And provides user feedback on success<\/li>\n<\/ol>\n\n\n\n<p>That&#8217;s literally all the code you need! Visual Studio handles all the complex database operations behind the scenes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Taking Your Application to the Next Level<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Adding Searching Capabilities<\/h3>\n\n\n\n<p>Users often need to find specific records. Let&#8217;s add search functionality:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add a TextBox named <code>txtSearch<\/code> and a Button named <code>btnSearch<\/code> to your form<\/li>\n\n\n\n<li>Add this code to the search button&#8217;s click event:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">private <span class=\"hljs-keyword\">void<\/span> btnSearch_Click(object sender, EventArgs e)\n{\n    <span class=\"hljs-comment\">\/\/ Get the search term<\/span>\n    string searchTerm = txtSearch.Text.Trim();\n    \n    <span class=\"hljs-keyword\">if<\/span> (string.IsNullOrEmpty(searchTerm))\n    {\n        <span class=\"hljs-comment\">\/\/ Reload all records if search box is empty<\/span>\n        <span class=\"hljs-keyword\">this<\/span>.myTableAdapter.Fill(<span class=\"hljs-keyword\">this<\/span>.myDataSet.MyTable);\n        <span class=\"hljs-keyword\">return<\/span>;\n    }\n    \n    <span class=\"hljs-comment\">\/\/ Filter the binding source<\/span>\n    <span class=\"hljs-keyword\">this<\/span>.myBindingSource.Filter = $<span class=\"hljs-string\">\"Name LIKE '%{searchTerm}%' OR Description LIKE '%{searchTerm}%'\"<\/span>;\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This allows users to search across multiple fields with a single query.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Adding Data Validation<\/h3>\n\n\n\n<p>Ensure your data meets business rules by adding validation:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select a TextBox control on your form<\/li>\n\n\n\n<li>In the Properties window, find the <code>Validating<\/code> event<\/li>\n\n\n\n<li>Create an event handler and add validation logic:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">private <span class=\"hljs-keyword\">void<\/span> txtPrice_Validating(object sender, CancelEventArgs e)\n{\n    <span class=\"hljs-comment\">\/\/ Try to parse the price as decimal<\/span>\n    <span class=\"hljs-keyword\">if<\/span> (!decimal.TryParse(txtPrice.Text, out decimal price) || price &lt; <span class=\"hljs-number\">0<\/span>)\n    {\n        <span class=\"hljs-comment\">\/\/ Show error and cancel the change<\/span>\n        errorProvider1.SetError(txtPrice, <span class=\"hljs-string\">\"Please enter a valid positive price.\"<\/span>);\n        e.Cancel = <span class=\"hljs-literal\">true<\/span>;\n    }\n    <span class=\"hljs-keyword\">else<\/span>\n    {\n        <span class=\"hljs-comment\">\/\/ Clear any error<\/span>\n        errorProvider1.SetError(txtPrice, <span class=\"hljs-string\">\"\"<\/span>);\n    }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Don&#8217;t forget to add an ErrorProvider component to your form for displaying validation messages.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Implementing Filtering with Dropdown Lists<\/h3>\n\n\n\n<p>Let&#8217;s add the ability to filter records by category:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add a ComboBox named <code>cboCategories<\/code> to your form<\/li>\n\n\n\n<li>Populate it with categories from your database<\/li>\n\n\n\n<li>Handle the selection change:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">private <span class=\"hljs-keyword\">void<\/span> cboCategories_SelectedIndexChanged(object sender, EventArgs e)\n{\n    <span class=\"hljs-keyword\">if<\/span> (cboCategories.SelectedIndex == <span class=\"hljs-number\">0<\/span>)\n    {\n        <span class=\"hljs-comment\">\/\/ \"All Categories\" option - remove filter<\/span>\n        <span class=\"hljs-keyword\">this<\/span>.myBindingSource.RemoveFilter();\n    }\n    <span class=\"hljs-keyword\">else<\/span>\n    {\n        <span class=\"hljs-comment\">\/\/ Filter by selected category<\/span>\n        string category = cboCategories.SelectedItem.ToString();\n        <span class=\"hljs-keyword\">this<\/span>.myBindingSource.Filter = $<span class=\"hljs-string\">\"Category = '{category}'\"<\/span>;\n    }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This gives users a quick way to view related records without complex queries.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Issues and Solutions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Problem: &#8220;Update requires a valid DeleteCommand&#8221;<\/h3>\n\n\n\n<p>This error typically appears when trying to delete records without a primary key defined in your database table. To fix it:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Ensure your table has a primary key defined<\/li>\n\n\n\n<li>Regenerate your TableAdapter with the updated schema<\/li>\n\n\n\n<li>Make sure the CommandBuilder has access to the primary key information<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Problem: Connection Errors<\/h3>\n\n\n\n<p>If your application can&#8217;t connect to the database:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Verify connection string parameters<\/li>\n\n\n\n<li>Check network connectivity<\/li>\n\n\n\n<li>Ensure SQL Server is running<\/li>\n\n\n\n<li>Confirm user permissions for the database<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Problem: Slow Performance with Large Datasets<\/h3>\n\n\n\n<p>When dealing with large tables:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Modify your TableAdapter queries to retrieve only the necessary records<\/li>\n\n\n\n<li>Implement paging to load data in chunks<\/li>\n\n\n\n<li>Use optimized queries with appropriate WHERE clauses<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Beyond the Basics: Advanced Techniques<\/h2>\n\n\n\n<p>Once you&#8217;ve mastered the core concepts, you can enhance your application with:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Multiple Related Tables<\/h3>\n\n\n\n<p>Connect parent-child relationships between tables:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add multiple TableAdapters to your project<\/li>\n\n\n\n<li>Configure master-detail relationships between forms<\/li>\n\n\n\n<li>Use foreign key constraints to maintain data integrity<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Reporting Capabilities<\/h3>\n\n\n\n<p>Add reporting functionality:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Integrate Microsoft Report Viewer controls<\/li>\n\n\n\n<li>Create customized reports from your data<\/li>\n\n\n\n<li>Export to PDF, Excel, or other formats<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Custom Data Processing<\/h3>\n\n\n\n<p>Implement business logic:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create helper classes for complex calculations<\/li>\n\n\n\n<li>Add background processing for time-consuming operations<\/li>\n\n\n\n<li>Implement data transformation logic<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Alternative Approaches for Modern Desktop Applications<\/h2>\n\n\n\n<p>While Windows Forms provides a quick way to build database applications, you might also consider:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WPF Applications<\/h3>\n\n\n\n<p><a href=\"https:\/\/codesamplez.com\/development\/getting-started-with-wpf-in-c-sharp\" target=\"_blank\" rel=\"noreferrer noopener\">Windows Presentation Foundation (WPF)<\/a> offers a more modern UI with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>XAML-based design (similar to web development)<\/li>\n\n\n\n<li>Advanced styling capabilities<\/li>\n\n\n\n<li>Better separation of UI and logic<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Entity Framework<\/h3>\n\n\n\n<p>For more complex database operations:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Object-relational mapping<\/li>\n\n\n\n<li><a href=\"https:\/\/codesamplez.com\/database\/linq-to-sql-c-sharp-tutorial\">LINQ queries<\/a> instead of SQL<\/li>\n\n\n\n<li>Code-first or database-first approaches<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Building C# desktop applications with database integration has never been easier. The drag-and-drop approach Visual Studio provides eliminates tedious coding and lets you focus on creating valuable features for your users.<\/p>\n\n\n\n<p>By following this tutorial, you&#8217;ve learned how to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set up a complete database connection<\/li>\n\n\n\n<li>Create data-bound forms with minimal code<\/li>\n\n\n\n<li>Implement CRUD operations (Create, Read, Update, Delete)<\/li>\n\n\n\n<li>Add validation, searching, and filtering capabilities<\/li>\n<\/ul>\n\n\n\n<p>Now you can build professional database applications that meet real business needs without wasting time on boilerplate code. The skills you&#8217;ve learned form a solid foundation for more advanced C# development projects.<\/p>\n\n\n\n<p>Have you built a C# desktop application using these techniques? What additional features did you implement? Share your experience in the comments below!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Additional Resources:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/ide\/create-csharp-winform-visual-studio?view=vs-2022\" target=\"_blank\" rel=\"noreferrer noopener\">Microsoft Tutorial: Create Windows Forms App in C#<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to build a simple C# desktop application with SQL Server integration using Visual Studio. This step-by-step guide covers creating a Windows Forms project, connecting to a database, and implementing basic CRUD operations\u2014all with minimal coding. Ideal for beginners seeking practical experience in data-driven application development.\u200b<\/p>\n","protected":false},"author":1,"featured_media":58495,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[16,11],"tags":[15,4],"class_list":{"0":"post-81","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-database","8":"category-development","9":"tag-net","10":"tag-c-sharp","11":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>C# Desktop Application With Database: A Step-by-Step Guide - CodeSamplez.com<\/title>\n<meta name=\"description\" content=\"Beginner-friendly guide to build powerful C# desktop applications with database integration using Visual Studio&#039;s data binding features.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C# Desktop Application With Database: A Step-by-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Beginner-friendly guide to build powerful C# desktop applications with database integration using Visual Studio&#039;s data binding features.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application\" \/>\n<meta property=\"og:site_name\" content=\"CodeSamplez.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codesamplez\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ranacseruet\" \/>\n<meta property=\"article:published_time\" content=\"2010-11-03T12:36:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-29T17:31:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Rana Ahsan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ranacseruet\" \/>\n<meta name=\"twitter:site\" content=\"@codesamplez\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rana Ahsan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application\"},\"author\":{\"name\":\"Rana Ahsan\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#\\\/schema\\\/person\\\/a82c3c07205f4bb73d6b3b0906bc328b\"},\"headline\":\"C# Desktop Application With Database: A Step-by-Step Guide\",\"datePublished\":\"2010-11-03T12:36:28+00:00\",\"dateModified\":\"2025-04-29T17:31:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application\"},\"wordCount\":1364,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2010\\\/11\\\/c-sharp-desktop-application.webp\",\"keywords\":[\".net\",\"c#\"],\"articleSection\":[\"Database\",\"Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application\",\"name\":\"C# Desktop Application With Database: A Step-by-Step Guide - CodeSamplez.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2010\\\/11\\\/c-sharp-desktop-application.webp\",\"datePublished\":\"2010-11-03T12:36:28+00:00\",\"dateModified\":\"2025-04-29T17:31:09+00:00\",\"description\":\"Beginner-friendly guide to build powerful C# desktop applications with database integration using Visual Studio's data binding features.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application#primaryimage\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2010\\\/11\\\/c-sharp-desktop-application.webp\",\"contentUrl\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2010\\\/11\\\/c-sharp-desktop-application.webp\",\"width\":1536,\"height\":1024,\"caption\":\"C# Desktop Application With Database Integration\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/c-sharp-desktop-application#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/codesamplez.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C# Desktop Application With Database: A Step-by-Step Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#website\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/\",\"name\":\"CODESAMPLEZ.COM\",\"description\":\"Programming And Development Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/codesamplez.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#organization\",\"name\":\"codesamplez.com\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/cropped-favicon.webp\",\"contentUrl\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/cropped-favicon.webp\",\"width\":512,\"height\":512,\"caption\":\"codesamplez.com\"},\"image\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codesamplez\",\"https:\\\/\\\/x.com\\\/codesamplez\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#\\\/schema\\\/person\\\/a82c3c07205f4bb73d6b3b0906bc328b\",\"name\":\"Rana Ahsan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g\",\"caption\":\"Rana Ahsan\"},\"description\":\"Rana Ahsan is a seasoned software engineer and technology leader specialized in distributed systems and software architecture. With a Master\u2019s in Software Engineering from Concordia University, his experience spans leading scalable architecture at Coursera and TopHat, contributing to open-source projects. This blog, CodeSamplez.com, showcases his passion for sharing practical insights on programming and distributed systems concepts and help educate others. Github | X | LinkedIn\",\"sameAs\":[\"https:\\\/\\\/github.com\\\/ranacseruet\",\"https:\\\/\\\/www.facebook.com\\\/ranacseruet\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ranacseruet\\\/\",\"https:\\\/\\\/x.com\\\/ranacseruet\"],\"url\":\"https:\\\/\\\/codesamplez.com\\\/author\\\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"C# Desktop Application With Database: A Step-by-Step Guide - CodeSamplez.com","description":"Beginner-friendly guide to build powerful C# desktop applications with database integration using Visual Studio's data binding features.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application","og_locale":"en_US","og_type":"article","og_title":"C# Desktop Application With Database: A Step-by-Step Guide","og_description":"Beginner-friendly guide to build powerful C# desktop applications with database integration using Visual Studio's data binding features.","og_url":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application","og_site_name":"CodeSamplez.com","article_publisher":"https:\/\/www.facebook.com\/codesamplez","article_author":"https:\/\/www.facebook.com\/ranacseruet","article_published_time":"2010-11-03T12:36:28+00:00","article_modified_time":"2025-04-29T17:31:09+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp","type":"image\/webp"}],"author":"Rana Ahsan","twitter_card":"summary_large_image","twitter_creator":"@ranacseruet","twitter_site":"@codesamplez","twitter_misc":{"Written by":"Rana Ahsan","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application#article","isPartOf":{"@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application"},"author":{"name":"Rana Ahsan","@id":"https:\/\/codesamplez.com\/#\/schema\/person\/a82c3c07205f4bb73d6b3b0906bc328b"},"headline":"C# Desktop Application With Database: A Step-by-Step Guide","datePublished":"2010-11-03T12:36:28+00:00","dateModified":"2025-04-29T17:31:09+00:00","mainEntityOfPage":{"@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application"},"wordCount":1364,"commentCount":9,"publisher":{"@id":"https:\/\/codesamplez.com\/#organization"},"image":{"@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application#primaryimage"},"thumbnailUrl":"https:\/\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp","keywords":[".net","c#"],"articleSection":["Database","Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codesamplez.com\/development\/c-sharp-desktop-application#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application","url":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application","name":"C# Desktop Application With Database: A Step-by-Step Guide - CodeSamplez.com","isPartOf":{"@id":"https:\/\/codesamplez.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application#primaryimage"},"image":{"@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application#primaryimage"},"thumbnailUrl":"https:\/\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp","datePublished":"2010-11-03T12:36:28+00:00","dateModified":"2025-04-29T17:31:09+00:00","description":"Beginner-friendly guide to build powerful C# desktop applications with database integration using Visual Studio's data binding features.","breadcrumb":{"@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codesamplez.com\/development\/c-sharp-desktop-application"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application#primaryimage","url":"https:\/\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp","contentUrl":"https:\/\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp","width":1536,"height":1024,"caption":"C# Desktop Application With Database Integration"},{"@type":"BreadcrumbList","@id":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codesamplez.com\/"},{"@type":"ListItem","position":2,"name":"C# Desktop Application With Database: A Step-by-Step Guide"}]},{"@type":"WebSite","@id":"https:\/\/codesamplez.com\/#website","url":"https:\/\/codesamplez.com\/","name":"CODESAMPLEZ.COM","description":"Programming And Development Resources","publisher":{"@id":"https:\/\/codesamplez.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codesamplez.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codesamplez.com\/#organization","name":"codesamplez.com","url":"https:\/\/codesamplez.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codesamplez.com\/#\/schema\/logo\/image\/","url":"https:\/\/codesamplez.com\/wp-content\/uploads\/2024\/10\/cropped-favicon.webp","contentUrl":"https:\/\/codesamplez.com\/wp-content\/uploads\/2024\/10\/cropped-favicon.webp","width":512,"height":512,"caption":"codesamplez.com"},"image":{"@id":"https:\/\/codesamplez.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codesamplez","https:\/\/x.com\/codesamplez"]},{"@type":"Person","@id":"https:\/\/codesamplez.com\/#\/schema\/person\/a82c3c07205f4bb73d6b3b0906bc328b","name":"Rana Ahsan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g","caption":"Rana Ahsan"},"description":"Rana Ahsan is a seasoned software engineer and technology leader specialized in distributed systems and software architecture. With a Master\u2019s in Software Engineering from Concordia University, his experience spans leading scalable architecture at Coursera and TopHat, contributing to open-source projects. This blog, CodeSamplez.com, showcases his passion for sharing practical insights on programming and distributed systems concepts and help educate others. Github | X | LinkedIn","sameAs":["https:\/\/github.com\/ranacseruet","https:\/\/www.facebook.com\/ranacseruet","https:\/\/www.linkedin.com\/in\/ranacseruet\/","https:\/\/x.com\/ranacseruet"],"url":"https:\/\/codesamplez.com\/author\/admin"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp","jetpack_shortlink":"https:\/\/wp.me\/p1hHlI-1j","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":187,"url":"https:\/\/codesamplez.com\/development\/application-settings-c-sharp","url_meta":{"origin":81,"position":0},"title":"App Config File in C#: Simplify Your Application Settings","author":"Rana Ahsan","date":"December 18, 2010","format":false,"excerpt":"This article provides a practical guide on managing application settings in C#.NET using configuration files. It explains how to store and retrieve single-value settings via the section and handle multiple-value settings through custom configuration sections. By leveraging the ConfigurationManager class and defining custom configuration classes, developers can externalize dynamic values\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/codesamplez.com\/category\/development"},"img":{"alt_text":"App Config File in C# Application","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":313,"url":"https:\/\/codesamplez.com\/development\/getting-started-with-wpf-in-c-sharp","url_meta":{"origin":81,"position":1},"title":"Getting Started with WPF in C#: The Ultimate Guide for Beginners","author":"Rana Ahsan","date":"January 30, 2011","format":false,"excerpt":"I've been working with WPF for years now, and trust me, it's absolutely revolutionary compared to the older Windows Forms technology. WPF introduces a completely different approach to UI development that separates design from logic through XAML. This separation is game-changing for developers who want to create modern, responsive applications.","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/codesamplez.com\/category\/development"},"img":{"alt_text":"Getting Started With C# WPF","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":22969,"url":"https:\/\/codesamplez.com\/programming\/multithreaded-programming-c-sharp","url_meta":{"origin":81,"position":2},"title":"Multithreaded Programming In C#: A Beginners Guide","author":"Rana Ahsan","date":"February 18, 2013","format":false,"excerpt":"In this guide, we explore the essentials of multithreaded programming in C#. Multithreading allows you to run tasks in parallel, improving the performance and responsiveness of your application. By leveraging the Thread and ThreadPool classes, developers can easily implement multithreading for tasks like database queries or UI operations.","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/codesamplez.com\/category\/programming"},"img":{"alt_text":"Multithreaded Programming C#","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/multi-threaded-programming-c-sharp.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/multi-threaded-programming-c-sharp.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/multi-threaded-programming-c-sharp.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/multi-threaded-programming-c-sharp.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/multi-threaded-programming-c-sharp.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/multi-threaded-programming-c-sharp.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":22728,"url":"https:\/\/codesamplez.com\/development\/wpf-hotkeys-c-sharp","url_meta":{"origin":81,"position":3},"title":"WPF HotKeys: Guide to Keyboard Shortcuts in WPF Applications","author":"Rana Ahsan","date":"January 17, 2013","format":false,"excerpt":"Learn how to wire up keyboard events and craft Alt-based hotkey combos in WPF with KeyGesture, RoutedCommand, and CommandBinding\u200b. The tutorial walks through both XAML and C# approaches, filters input via KeyEventArgs, fires MessageBox alerts for Alt + A\/B, and also clarifies modifier keys, handler reuse for mouse clicks, and\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/codesamplez.com\/category\/development"},"img":{"alt_text":"WPF HotKeys C#","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":829,"url":"https:\/\/codesamplez.com\/development\/using-doctrine-with-codeigniter","url_meta":{"origin":81,"position":4},"title":"Doctrine With CodeIgniter: DB Modeling In CodeIngiter Like A Pro","author":"Rana Ahsan","date":"June 15, 2011","format":false,"excerpt":"Learn how to integrate Doctrine ORM with CodeIgniter in this tutorial, which provides step-by-step guidance and PHP code examples. Discover how to set up Doctrine within the CodeIgniter framework and leverage its features for efficient database modeling and management. This guide is ideal for developers aiming to enhance their CodeIgniter\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/codesamplez.com\/category\/development"},"img":{"alt_text":"doctrine with codeigniter","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/06\/doctrine-with-codeigniter.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/06\/doctrine-with-codeigniter.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/06\/doctrine-with-codeigniter.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/06\/doctrine-with-codeigniter.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/06\/doctrine-with-codeigniter.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/06\/doctrine-with-codeigniter.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":24261,"url":"https:\/\/codesamplez.com\/development\/php-dependency-injection","url_meta":{"origin":81,"position":5},"title":"PHP Dependency Injection: The Ultimate Guide","author":"Rana Ahsan","date":"April 28, 2014","format":false,"excerpt":"The article \"PHP Dependency Injection With Pimple\" on CodeSamplez.com introduces developers to the concept of dependency injection in PHP using the Pimple container. It explains how Pimple facilitates managing object dependencies, promoting cleaner and more maintainable code. Through practical examples, the article demonstrates defining services and parameters within Pimple, showcasing\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/codesamplez.com\/category\/development"},"img":{"alt_text":"php dependency injection","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2014\/04\/php-dependency-injection.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2014\/04\/php-dependency-injection.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2014\/04\/php-dependency-injection.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2014\/04\/php-dependency-injection.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2014\/04\/php-dependency-injection.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2014\/04\/php-dependency-injection.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/posts\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":4,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"predecessor-version":[{"id":58497,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/posts\/81\/revisions\/58497"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/media\/58495"}],"wp:attachment":[{"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}