コード例 #1
0
        public void EntryCreate(string entrysitename, string entryusername, string entrypassword, string entryemail, string entrynumber)
        {
            try
            {
                string connstring = ConfigurationManager.ConnectionStrings["dbx"].ConnectionString;
                string strQuery   = "INSERT INTO EntryForm (Entry_Site_Name,Entry_Username,Entry_Password,Entry_Email,Entry_Number,Entry_SignUpMail) values (@Entry_Site_Name,@Entry_Username,@Entry_Password,@Entry_Email,@Entry_Number,@Entry_SignUpMail)";

                using (OleDbConnection con = new OleDbConnection(connstring))
                {
                    using (OleDbCommand cmd = new OleDbCommand(strQuery, con))
                    {
                        con.Open();
                        cmd.Parameters.AddWithValue("@Entry_Site_Name", entrysitename);
                        cmd.Parameters.AddWithValue("@Entry_Username", entryusername);
                        cmd.Parameters.AddWithValue("@Entry_Password", entrypassword);
                        cmd.Parameters.AddWithValue("@Entry_Email", entryemail);
                        cmd.Parameters.AddWithValue("@Entry_Number", entrynumber);
                        cmd.Parameters.AddWithValue("@Entry_SignUpMail", LoginFor.name());


                        cmd.ExecuteNonQuery();
                        con.Close();
                        MessageBox.Show("Record is saved successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
 public UserDashboard()
 {
     InitializeComponent();
     abc = LoginFor.name();
     timer1.Start();
 }