I currently use SQL queries (select, procedures, functions) for communication with database.
Till now I have not used Dataset. I really can’t get the concept of dataset. I just know that they can be used to select, insert, update, or delete from database too.
But why would be even need a dataset, when we can use the SQL commands to do the same tasks.
Is dataset better in terms of security? Or is it faster?
Update:
So I read this forum ashutosh gave
http://social.msdn.microsoft.com/Forums/en/adodotnetdataset/thread/100cce91-cf9c-46c9-986a-98a409a196f2
DataSet on the other side can be created from designer. Designer allows you to create tables, relations, contraints,… Drag and drop from Server Explorer might be another benefit. With DataAdpater you can create a typed DataSet upon the queries. If you’re application requires import/export, you’ll have to write this functionality on your own when using custom entities. With DataSet this ain’t a problem, allowing you to import/export data into XML. It can also be bound to DataGridView or any other similar control. DataSet also supports one level of history, allowing you to revert to previous version of each row.
Quite helpful, But still question persists, should I use Datasets or queries to handle database. Like editing records, updating, deleting and such.
I use my queries like:
SqlCommand cmdCheck = default(SqlCommand);
string strQry ="Update, Delete, Insert queries";
cmdCheck = new SqlCommand(strQry, Connection);
openConnection();
cmdCheck.ExecuteCommand();
CloseConnection();
and DataAdapter For select queries.
Not any good answer till now. 🙁
So I would think it is better to use queries than Datasets.
because
– Datasets can be difficicult to manage for large datas. I think they may cause slow data transfers.
– the Sql queries are short and simple to write.
– I know sql queries better because i have not used datasets till now.
If i am wrong do reply with resonable answers.