C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ADO.NET »

Save the details to backend by ADO.NET


Posted Date: 30 Aug 2009    Resource Type: Code Snippets    Category: ADO.NET
Author: NikhilMember Level: Silver    
Rating: 1 out of 5Points: 4



Marry has recently joined as a tellecalling executive in a call centre CallNetInc. Ltd. Her details need to be entered into the system. As a part of the development team, you need to create an application in which the details of the employee being entered in the form getsdetail of the employee being entered in the form gets saved in the database. The details of the employee are stored in the Employees table in the HR database. Identify the correct code to accomplish this task. Assume the connection to be already open where connection is the connection object.


SqlDataAdapter adapter = new SqlDataAdapter("Select * from Employees", connection);
SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(adapter);
DataSet ds = new DataSet("Employees");
adapter.Fill(ds, "Employees");
DataRow row = ds.Tables["Employees"].NewRow();
row["empId"] = textBox1.Text;
row["empName"] = textBox2.Text;
row["empSal"] = textBox3.Text;
ds.Tables["Employees"].Rows.Add(row);
adapter.Update(ds, "Employees");


For more details, visit www.dotnetask.blog.co.in



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Save the details to backend by ADO.NET  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Bulk Copy Operation
Previous Resource: Login by backend table data
Return to Discussion Resource Index
Post New Resource
Category: ADO.NET


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use