Inserting data into a Database
- by Erebus
SO I'm making a "basic" login file where a person logs in and the data that person entered on that form gets transfered to another form aka my database/table.
I think the problems is here but I'll post the rest of the code.
CREATE FUNCTION dbo.Function4
 (
 parameter1 int = 5,
 parameter2 datatype
 )
RETURNS Table1 TABLE (UserName, Password, Password_Confirmation, Assets)
AS
 BEGIN
   INSERT INTO Table1
   (UserName, Password, Password_Confirmation, Assets)
   VALUES
   (a,b,c,d);
     /*SELECT ... FROM ...*/
 RETURN
 END
This is the Login Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Login_Basic
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
        Form3 Delta = new Form3();
        private void label3_Click(object sender, EventArgs e)
        {
        }
        private void Form2_Load(object sender, EventArgs e)
        {
            this.Hide();
        } 
        private void textBox6_TextChanged(object sender, EventArgs e)
        {
        }
        private void textBox6_KeyPress(object sender, KeyPressEventArgs e)
        {
            int i = Convert.ToInt32(e.KeyChar);
            if (!(Char.IsDigit(e.KeyChar) || Char.IsControl(e.KeyChar) || (e.KeyChar == '.' && this.Text.Contains(".") == false)))
                e.Handled = true;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Delta.Show();
            //if (textBox3.Text.Equals(""))
            //{
            //    MessageBox.Show("Please enter your username");
            //}
            //else
            //{
            //    this.Hide();
            //}
           // if (textBox4.Text.Equals(""))
            //{
            //    MessageBox.Show("Please enter your password");
           // }
           // else
            //{
            //    this.Hide();
           // }
           // if (textBox5.Text.Equals(""))
           // {
           //     MessageBox.Show("Please re-enter your password");
           // }
           // else
           // {
           //     this.Hide();
           // }
            //if (textBox6.Text.Equals(""))
            //{
           //     MessageBox.Show("Please enter your amount");
           //     
           // }
           // else
           // {
           //     this.Hide();
           // }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
        }
        private void textBox3_TextChanged(object sender, EventArgs e)
        {
        }
        private void textBox4_TextChanged(object sender, EventArgs e)
        {
        }
        private void textBox5_TextChanged(object sender, EventArgs e)
        {
        }
        private void panel2_Paint(object sender, PaintEventArgs e)
        {
            /*if (textBox3.Text.Equals("") && textBox4.Text.Equals("") && textBox5.Text.Equals("") && textBox6.Text.Equals(""))
            {
                button1.Enabled = false;
            }
            else
            {
                button1.Enabled = true;
            }*/
        }
    }
}
Here's a "Pic" of my database
http://s299.photobucket.com/albums/mm305/krsimms123/Code.jpg
Thanks in advance (I'll try and check this every few hours so I can help explain anything)