 |
|
[.NET]
สร้างตัวแปร รับค่า DateTime วันเวลาปัจจุบัน แล้ว Insert ลง DB ทำยังไงครับ C#.NET |
|
 |
|
|
 |
 |
|
ฐานข้อมูลเป็น DateTime อ่ะครับ Format คือ yyyy-mm-dd H:i:s
ต้องทำไงอ่ะครับ
Code (C#)
1.
2. d = ..............
3.
4.
5.
6. MySqlCommand SelectCommand1 = new MySqlCommand( "INSERT INTO finalproject.topup (date,amount,userID,staffID) VALUES ('" ................ + "','" + this .numericUpDown1.Text + "','" + this .label1.Text + "','" + this .label12.Text + "');" , myConn);
Tag : .NET, Win (Windows App), C#, VS 2012 (.NET 4.x)
|
ประวัติการแก้ไข 2014-07-21 04:06:04
|
 |
 |
 |
 |
Date :
2014-07-21 01:11:56 |
By :
jpong7 |
View :
2343 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เปลี่ยน Format ที่เครื่องครับ
โดยเข้าไปที่ Control Panel เลือก Region คลิกที่ Additional setting.... ดูที่แท็บด้านบน คลิ้กเลือกที่ Date ...
ดูที่ Calendar type ด้านล่าง เลือกรูปแบบที่ตามที่ต้องการครับ

|
 |
 |
 |
 |
Date :
2014-07-21 02:27:05 |
By :
Zakariya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|