iT邦幫忙

2025 iThome 鐵人賽

0

目的

測試CSV匯出、匯入功能

匯出:
1.確保資料庫內有測試數據
前面我們已經有新增過牛肉跟白飯 , 先來進行匯出功能。
https://ithelp.ithome.com.tw/upload/images/20251020/20178845WHwUlrOibA.jpg


2.確認檔案位置
https://ithelp.ithome.com.tw/upload/images/20251020/20178845Suzx0e0EQP.jpg


3.檢查Excel檔
確認中文能正常顯示、數據被分到不同的欄位中。https://ithelp.ithome.com.tw/upload/images/20251020/20178845u5oyCeHIJk.jpg


4.用記事本打開檔案檢查原始碼
確保有抓到9個數據。
https://ithelp.ithome.com.tw/upload/images/20251020/20178845d0TjlDcddF.jpg


匯入:
1.準備新數據
這裡加一筆與之前牛肉的資料相同的記錄 , 看份量有沒有累加。
第二筆:改份量。
第三筆:欄位數量錯誤。
https://ithelp.ithome.com.tw/upload/images/20251020/201788451h9pTfABNC.jpg


2.結果
https://ithelp.ithome.com.tw/upload/images/20251020/20178845v8BltW06B6.jpg
https://ithelp.ithome.com.tw/upload/images/20251020/20178845YgZgvIimXS.jpg


3.驗證
用功能8看牛肉份量有沒有累加、麵包有沒有新增進去、雞蛋錯誤的格式有沒有放入。
https://ithelp.ithome.com.tw/upload/images/20251020/20178845TluljQqosJ.jpg


上一篇
加入CSV匯入功能
下一篇
優化程式碼,確保DAO與主程式分離
系列文
飲食營養追蹤 + 健康分析 Web 系統30
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言