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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sandeep Singh ShekhawatPosted Jun 15, 2013, 7:31 AM
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
Ankit KuPosted Jun 15, 2013, 7:23 AM
Sandeep Singh ShekhawatPosted Jun 15, 2013, 6:54 AM
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
Ravi ShekharPosted Jun 15, 2013, 6:51 AM
by ... microsoft
Regards,
Ravi