Exceedinglife's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
83 (0.08 per day)
Joined:
01-July 12
Profile Views:
1,228
Last Active:
User is offline Apr 09 2015 06:51 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Subaru
Dream Kudos:
0
Icon   Exceedinglife has not set their status

Posts I've Made

  1. In Topic: 2 database tables, 1 combo box select field to populate datagridview

    Posted 7 Feb 2015

    Could you show me and give me an example please? Then ill have something to reference and know what i have to do.
  2. In Topic: Doing CRUD with C# and SQL best ways do to do and display data

    Posted 3 Feb 2015

    i been trying to get example 2 to work but i am not sure why i cant get it going this is what i have
    i get no errors but no creation of a record in the database ether..

        public static class crud
        {
            public static string connectionString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\crud.mdf;Integrated Security=True";
        
        
            public static void CreateUser(User user)
            {
                SqlConnection connect = new SqlConnection(connectionString);
                string create = "INSERT INTO [dbo].[Table](userName, userType) VALUES(@userName, @userType)";
                SqlCommand createcmd = new SqlCommand(create, connect);
                createcmd.Parameters.AddWithValue("@userName", user.UserName);
                createcmd.Parameters.AddWithValue("@userType", user.UserType);
                try
                {
                    connect.Open();
                    createcmd.ExecuteNonQuery();
                }
                catch (SqlException sql) { MessageBox.Show(sql.Message.ToString()); }
                catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); }
                finally
                {
                    connect.Close();
                }
            }
        }
    
    public class User
        {
            //user id property field
            private int userID;
            public int UserID
            {
                get { return userID; }
                set { userID = value; }
            }
    
            //username property field
            private string userName;
            public string UserName
            {
                get { return userName; }
                set { userName = value; }
            }
    
            //usertype property field
            private string userType;
            public string UserType
            {
                get { return userType; }
                set { userType = value; }
            }
    
            //constructors
            public User() { }
    
            public User(string uname, string utype)
            {
                UserName = uname;
                UserType = utype;
            }
    
            public override string ToString()
            {
                //return base.ToString();
                return "UserID: " + this.UserID + "\nUserName: " + this.UserName + "\nUserType: " + this.UserType;
            }
        }
    
    public partial class Form1 : Form
        {
            public User newuser;
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void MakeUser(User user)
            {
                user.UserName = txtUsername.Text;
                user.UserType = txtUsertype.Text;
            }
    
            private void btnSubmit_Click(object sender, EventArgs e)
            {
                string name = txtUsername.Text;
                string type = txtUsertype.Text;
    
                newuser = new User();
                MakeUser(newuser);
                try
                {
                    crud.CreateUser(newuser);
                }
                catch(Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }
            }
        }
    
    
  3. In Topic: visual studio 2013 database .mdf add query

    Posted 25 Dec 2014

    i fixed it
    i was missing a ")"
  4. In Topic: making method in an unordered list for organizing

    Posted 10 Dec 2014

    the choices are coming from a sharepoint list so the manager of the restaurant can just add a item to the list and it will automatically put them in the control whenever she decides to add new items

    i just have to add some padding / margin to the controls to add more space

    I talked about having cheese separated but she is doing the cost the same as meat / cheese so you only allowed so many before and extra charge is added

    i want each row to contain 3 - 4 items then for it to make a new row
  5. In Topic: making method in an unordered list for organizing

    Posted 10 Dec 2014

    right now i have it in a fieldset

    my list of checkboxes are in 1 row

    i want 3 or 4 rows instead of 1 so it looks alot more neat

    Posted Image

    	<!-- Select fillings -->
            <div id="selectFillings">
                <div id="fillingValid" class="validation alert"></div>
                <fieldset id="fillings">
                    <legend><h4>4). Choose up to two fillings (Extra + $1.20)</h4></legend>
                    <table id="fillingsTable"></table>
                </fieldset>
            </div>
    
        function initializeCheckBox(elementName, dataService, render, name) {
            if (render === null) render = function(item) { return(item.text); };
            var $element = $(elementName);        
            $.when(dataService()).then(function (data) {
                var $unorderedList = $('ul class="stylebox"');
                $element.append($unorderedList);
                console.log($unorderedList);
    
                for (var itemIndex in data) {
                    var $input = $('<input type="checkbox" name ="'+name+'" value="' + data[itemIndex].value + '">' + render(data[itemIndex]) + '</input>');
                    var $row = $('<li>'); 
                    $input.data(data[itemIndex]);
    				$input.appendTo($element);
                }
            });
        }
    
        function initializeRadioBtn(elementName, dataService) {
            var $element = $(elementName);
            $.when(dataService()).then(function (data) {
                for (var itemIndex in data) {
                    var $input = $('<input type="radio" name ="Side" value="' + data[itemIndex].value + '">' + data[itemIndex].text + '</input>');
    				$input.data(data[itemIndex]);
    				$input.appendTo($element);
                }
            });
        }
    
         */
        function getFillings() {
            var deferred = new $.Deferred();
            deferred.resolve([
                { value: 'Turkey Breast', text: 'Turkey Breast', price: 0.0 },
                { value: 'Baked Ham', text: 'Baked Ham', price: 0.0 },
                { value: 'Salami', text: 'Salami', price: 0.0 },
                { value: 'Cheddar Cheese', text: 'Cheddar Cheese', price: 0.0 },
                { value: 'Swiss Cheese', text: 'Swiss Cheese', price: 0.0 },
                { value: 'Provologne Cheese', text: 'Provologne Cheese', price: 0.0 },
                { value: 'Veggie Mix', text: 'Veggie Mix', price: 0.0 }
            ]);
            return (deferred);
        }
    
    

My Information

Member Title:
D.I.C Head
Age:
24 years old
Birthday:
January 24, 1991
Gender:
Location:
Wisconsin
Full Name:
Andrew
Years Programming:
1
Programming Languages:
Java
HTML
CSS
JavaScript
Little bit of PHP
C# currently learning

Contact Information

E-mail:
Click here to e-mail me

Friends

Exceedinglife hasn't added any friends yet.

Comments

Exceedinglife has no profile comments yet. Why not say hello?