Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Developer Journal - C# and SQL  (Read 2577 times)

0 Members and 1 Guest are viewing this topic.
Developer Journal - C# and SQL
« on: February 28, 2013, 10:07:42 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
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
        }


    }
}
« Last Edit: February 28, 2013, 10:14:28 am by Theforeshadower »
Logged
  • Super Fan Gamers!

Antidote

>.>
Re: Developer Journal - C# and SQL
« Reply #1 on: March 01, 2013, 12:56:53 am »
  • In all seriousness who's serious?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1485
SQL isn't too difficult, if you have any difficulties just refer to the MySQL website or ask someone here for advice :P
Logged
  • Axiomatic Data Laboratories
Re: Developer Journal - C# and SQL
« Reply #2 on: March 01, 2013, 07:10:41 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
Logged



i love big weenies and i cannot lie
Re: Developer Journal - C# and SQL
« Reply #3 on: March 01, 2013, 08:33:57 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
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.
Logged
Pages: [1]   Go Up

 


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



Page created in 0.041 seconds with 45 queries.

anything