connection and without any query in C#.
C#
By which namespace we can use all the sql function without creating any
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ravi ShekharRank #673 · 3.6K reputationPosted Jun 15, 2013, 2:51 AM EDT
by ... microsoft
Regards,
Ravi
Sandeep Singh ShekhawatRank #147 · 15.6K reputationPosted Jun 15, 2013, 2:54 AM EDT
You need to create a class library which under a single namespace.
It has several classes according to function and queries which you want perform and these classes implement Connection,Command classes/interface as per provider.
Then you can use own namespace for access classes then access methods according requirements from these classes.
Namespace is a logical collection of classes and these classes have method/properties etc. So your actual functionality will be through classes.
For example
System.Data.SqlClient;
namespace has several method for Connection and queries when we are working with Sql Server. like
SqlConnection con = new SqlConnection();//Connection
SqlCommand cmd = new SqlCommand();//Queries
SqlDataAdapter adp = new SqlDataAdapter();//Queries
But you can use enterprises libraries that has several methods for connection, queries and store procedure. please go through below link that has resource which explain that how can use libraries.
http://www.c-sharpcorner.com/tags/1/enterprises-libraries
You can download it
http://msdn.microsoft.com/en-us/library/dn169621.aspx
Documentation
https://entlib.codeplex.com/releases/view/64243
Thanks
Ankit Ku12 reputationPosted Jun 15, 2013, 3:23 AM EDT
Sandeep Singh ShekhawatRank #147 · 15.6K reputationPosted Jun 15, 2013, 3:31 AM EDT
So do you want use sql function like Count(),SUM(), MIN()
and expression like Where,order by etc.
Then you can use linq to sql which have DataContext class and you can perform operation on .dbml file's context class.
http://www.c-sharpcorner.com/UploadFile/3d39b4/simple-select-insert-update-and-delete-using-linq-to-sql/
http://www.c-sharpcorner.com/UploadFile/3d39b4/aggregate-functions-in-linq-to-sql/
http://www.c-sharpcorner.com/UploadFile/3d39b4/inner-join-cross-join-and-left-outer-join-with-linq-to-sql/
Thanks