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 within that DataGrids. I’ve created the database that I’m going to be using for the application. I want to know if I should use SqlCommand-SqlDataReader or SqlDataAdapter-DataSet instead. Which approach is better?
I’m creating something like a small cashier application that keeps record for the clients,
Share
This is highly depend upon type of operation you want.
Following is my suggetion.
If you want to read data faster go for SQLDataReader but that comes as cost of operation you need to take
during read after that also.
Open Connection
Read Data
Close Connection. If you forgot to close than it will hit performance.
Go for SQLDataAdapter
Use SQLCommand ( This will also comes when you read SQLDataReader for read data) and for insert and update.
If you are using .NET Frame 3.5 sp1 or later i would suggest Linq to SQL or Entity Framework would also
solve your purpose.
Thanks.