http://z58134g.blogspot.tw./

https://drive.google.com/folderview?id=0B961WZvILJrgb1g1M3JHQkxOZms&usp=sharing

 

 

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;

using System.Data.OleDb;//**
using System.IO;//**
namespace WindowsFormsApplication14
{
    public partial class Form1 : Form
    {
        private OleDbConnection connection = new OleDbConnection();

        public Form1()
        {

            InitializeComponent();
            connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\loveizake\Desktop\WindowsFormsApplication14\WindowsFormsApplication14\bin\Debug\Database22.accdb");
             


        }

   

       
             private void button1_Click(object sender, EventArgs e)
        {
            connection.Open();

            OleDbCommand command2 = new OleDbCommand();

            command2.Connection = connection;

            command2.CommandText = "insert into 學生資料 (學生姓名,學生號碼,生日,性別) values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')";

            command2.ExecuteNonQuery();

        

            connection.Close();
             
        
        }

    }
}

 

 

 

 

phpMyAdmin登入畫面,當然您也可以透過網址來登入管理資料庫:「http://127.0.0.1/phmyadmin」或是「http://localhost/phpmyadmin」,登入名稱為「root」,密碼部分請留空,然後點擊﹝執行﹞。

arrow
arrow
    全站熱搜

    harry123168 發表在 痞客邦 留言(0) 人氣()