ZFGC

Resources => Coding => Topic started by: Theforeshadower on February 28, 2013, 10:07:42 am

Title: Developer Journal - C# and SQL
Post by: Theforeshadower on February 28, 2013, 10:07:42 am
I have not programmed anything with my full attention for some time.  I have been looking at job postings for C# since that is my language of choice as most of you know.  Alot of them prefer some sort of SQL experience and I have zero knowledge in sql.  So, I started learning some sql and how to use it with C#.  Since I also know nothing about asp/ado(online C#), I am writing a simple WPF program.

Here is the goal:
Generate 50 users in a database.
Randomly generate numbers that are added to each user in the form of posts/likes/dislikes
Add a search to look up an user
Once you select a user, graphically(text or whatever) show the number of posts-likes-dislikes

Simple enough.  Since I don't know anything about sql, anytime I do something bizarre, let me know XD.  I won't release an application to run until there is something solid, however, I will post my code here. :D  Not trying to get too serious into it right now.  Just looking to get my feet wet and provide an example if it is needed by a potential employer.

Current Code(latest update will always be here):
Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Data.Sql;
using System.Data.SqlClient;

namespace sqlWPF
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        SqlConnection sqlConnection = new SqlConnection();

        public MainWindow()
        {
            InitializeComponent();
            try
            {
                sqlConnection.Open();
            }
            catch (Exception e)
            {
                textBlock1.Text.Insert(0, e.ToString());
            }
        }

        private void generateButton_Click(object sender, RoutedEventArgs e)
        {
            //Will be used to generate 50 users onto the database
        }


    }
}
Title: Re: Developer Journal - C# and SQL
Post by: Antidote on March 01, 2013, 12:56:53 am
SQL isn't too difficult, if you have any difficulties just refer to the MySQL website or ask someone here for advice :P
Title: Re: Developer Journal - C# and SQL
Post by: MG-Zero on March 01, 2013, 07:10:41 pm
http://zfgc.com/forum/index.php?topic=40295.0

I'll just leave this here :P
Title: Re: Developer Journal - C# and SQL
Post by: Zaeranos on March 01, 2013, 08:33:57 pm
I have done some SQL for work. However I find using Entity Framework and Linq much easier to use with C# and databases. I guess everyone has their preferences.

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved