Click here to Skip to main content
15,891,473 members
Articles / Database Development / SQL Server

Using ADO.NET programmatically with C#

Rate me:
Please Sign up or sign in to vote.
2.86/5 (32 votes)
15 Dec 2005CPOL4 min read 168.5K   3.9K   39  
An article on using ADO.NET programmatically.
2005/10/23	14:17	Library Manager Visual C#.NET, ADO.NET, SQL
					Just started to develop the app.
					Created mainForm, replaced a menu, a toolbar, and
					a statusbar control.
2005/10/27	23:36	created database : Library, and Books table.
					created images n added to imagelist
					added buttons, arranged statusbar				
					arranged menu.
2005/10/28	23:11	Added textboxes, labels, and a datagrid.
					Added about form.
2005/11/05	08:41	Redesigned the database.(added Code)
					Added DataManipulationClass to FormMain.
					Done some arrangements with the controls.
					Done synchronization of the textboxes and the datagrid.
			23:10	Added AddData function, done some modifications on controls	
2005/11/06	10:01	Added Delete, Search and Reload features.
					Need some improvements about deletion and addition (see D001,D002)
2005/11/07	23:15	Added Modify feature, and arranged menu items, arranged aboutform.(see D003)
2005/11/09	23:47	Tested a bug was found (E001)
					Some arrangements on code.
2005/11/12	14:39	Replaced parameters to sql queries in ModifyData, DeleteData, 
					SearchData, and AddData functions.
					Added more remarks to code.
			15:05	fixed E001 if the textbox is null then assign the value to 0.			
2005/12/13	01:07	Added a new feature to create the database, the table used by this program
					and inserted an initial row.
					Added a menu group and an item Create Database to use the feature above.
			22:58	Added BookID Coloumn to dataGrid and Done Modify and Delete Queries according
					to it. fixed D001 and D002

Debug 

-D001 DeleteData() must delete only selected data row.
D002 AddData() must check whether the necessary columnns textboxes filled.
-D003 ModifyData must also modify Title column


Error

-E001 System.FormatException when modifying a null textbox


			int iposition;
			mycm=(CurrencyManager)this.BindingContext[datac.myds,"users"];
			iposition=mycm.Position+1;
			label1.Text=iposition.ToString();

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Software Developer (Senior)
Turkey Turkey
Started writing code in 1988. There were GW Basic, Turbo Pascal, Turbo C under DOS.
While studentship there were Assembly, C++, digital electronics, microprocessors..in the scene as new things. Then next versions, next generations like Visual Basic, Delphi, C++ Builder, next platforms like Windows, Win32, Linux. Last years many projects took place using various tech and under various platforms. New technologies and IDEs like Delphi 2005, Visual Studio 2003, 2005, C#, ASP.NET, ADO.NET, Metodologies and Tools like UML, Starteam..

Comments and Discussions