Click here to Skip to main content
15,123,727 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am going to start one small application.

I want to assign my connection and reader in one class file instead of using in inlne code.

Also, i don't want to call everytime connection and reader.

I want to maintain one class file. In that, whenever i want the connection or reader just i want call that function and execute the Stored rocedure's.

pls. give me one example with one small stored procedure with select/insert/delete using class file for connection and reader.

Thanks.
Posted

1 solution

First you have to create a helper class with the CRUD operation methods and that should implement the ADO.NET coding and get the connectingstring from config file.
Call the appropriate method for your operation and as well as handle the return type
Have a look on http://srikanthtechnologies.com/blog/dotnet/adonetcrud2.aspx[^]
You will get an idea.
   
Comments
gani7787 27-Aug-12 5:56am
   
can you give more example on this...?
Prabhakaran Soundarapandian 27-Aug-12 6:05am
   
Find this with Code..
https://github.com/jhgbrt/yadal/blob/master/YaDal/YaDal.cs
and you can find the sample for above code in https://github.com/jhgbrt/yadal

and also the below link will have same

http://www.deitel.com/ResourceCenters/Programming/ADONET/ADONETDataAccessLayer/tabid/3176/Default.aspx

http://www.blackbeltcoder.com/Articles/ado/an-ado-net-sql-helper-class

If you find this as useful rate it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900