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

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
86 (0.07 per day)
Joined:
01-July 12
Profile Views:
1,380
Last Active:
User is offline Today, 01:08 PM
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: Form screen size adjust control sizes

    Posted 4 Sep 2015

    Ok yes that is what i mean.
    Then we are using VB.Net
    Thank you for clearing that up for me.
    I am working on trying to have the company migrate to Visual Studio 2012 or 2013 which would be nice.
    This is my first time ever using 2008.
  2. In Topic: Form screen size adjust control sizes

    Posted 3 Sep 2015

    correct vb6 visual studio 08 the company i'm working for is using.
  3. 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.
  4. 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());
                }
            }
        }
    
    
  5. In Topic: visual studio 2013 database .mdf add query

    Posted 25 Dec 2014

    i fixed it
    i was missing a ")"

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?