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; namespace WindowsFormsApplication3 { public partial class Form1 : Form { OleDbConnection myConn = new OleDbConnection(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { myConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\Member.mdb"; myConn.Open(); } private void button1_Click(object sender, EventArgs e) { OleDbCommand mycommand = new OleDbCommand(); OleDbTransaction myTransaction; OleDbParameter CustomerID = new OleDbParameter(); CustomerID.ParameterName = "@Cus"; CustomerID.OleDbType = OleDbType.Integer; CustomerID.Direction = ParameterDirection.Input; CustomerID.Value = textBox1.Text; OleDbParameter Username = new OleDbParameter(); Username.ParameterName = "@Uname"; Username.OleDbType = OleDbType.Integer; Username.Direction = ParameterDirection.Input; Username.Value = textBox2.Text; myTransaction = myConn.BeginTransaction(); mycommand.CommandText = "INSERT INTO member(CustomerID,Username)VALUES(@Cus,@Uname)"; mycommand.CommandType = CommandType.Text; mycommand.Transaction = myTransaction; mycommand.Connection = myConn; mycommand.Parameters.Add(CustomerID); mycommand.Parameters.Add(Username); mycommand.ExecuteNonQuery(); myTransaction.Commit(); textBox1.Text = ""; textBox2.Text = ""; myTransaction.Rollback();
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง