SqlCommand or SqlDataAdapter?

后端 未结 6 1042
鱼传尺愫
鱼传尺愫 2020-12-10 05:21

I\'m creating something like a small cashier application that keeps record for the clients, employees, services, sales, and appointments. I\'m using windows forms, and withi

6条回答
  •  没有蜡笔的小新
    2020-12-10 05:46

    SqlDataAdapter

    • stores data on your client and updates database as necessary. So it consumes more memory.
    • On the other hand you wouldn't need to be connected to your database on insert/delete/update/select command.
    • It manages connections internally so you wouldn't have to worry about that.

    All good stuff from SqlDataAdapter come at a cost of more memory consumption. It's usually used for systems that need multiple users connected to database.
    So I'd say if that's not your situation go for SqlCommand and the connected model.

提交回复
热议问题