Command.ExecuteNonQuery();
System.Data.OleDb.OleDbConnection objConn; System.Data.OleDb.OleDbCommand objCmd; String strConnString,strSQL; strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("database/mydatabase.mdb")+";Jet OLEDB:Database Password=;"; objConn = new System.Data.OleDb.OleDbConnection(strConnString); objConn.Open(); strSQL = "INSERT INTO customer (CustomerID,Name,Email,CountryCode,Budget,Used) " + "VALUES ('C005','Weerachai Nukitram','[email protected]','TH','2000000','1000000')"; objCmd = new System.Data.OleDb.OleDbCommand(); try { objCmd.ExecuteNonQuery(); } catch( Exception ex) { lblText.Text = lblText.Text + "<br> - Record not insert was (" + ex.Message + ")"; } objCmd = null; objConn.Close(); objConn = null;
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท