Your SlideShare is downloading. ×
0
ADO.NETObjects
ADO.NETObjects
ADO.NETObjects
ADO.NETObjects
ADO.NETObjects
ADO.NETObjects
ADO.NETObjects
ADO.NETObjects
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

ADO.NETObjects

1,179

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,179
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
131
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ADO.NET Objects<br />SqlCommand<br />SqlConnection<br />SqlDataReader<br />SqlDataAdapter<br />DataTable<br />DataSet<br />DataView<br />
  • 2. ADO.NET Objects<br /><ul><li> Connection helps you identify</li></ul>Database Server<br />Database Name<br /> Password<br />UserName<br />SqlConnection<br />Database<br />
  • 3. ADO.NET Objects<br /> SqlConnection con= new SqlConnection (“Data Source=(local);Initial <br /> Catalog=Master; Integrated Security=SSPI”);<br /> SqlConnection con= new SqlConnection (“Server=&lt;Servername&gt;;Data<br /> Source=(local);uid=&lt;SqlServerUserId&gt;;Pwd=&lt;SqlServer Password&gt;”);<br />
  • 4. ADO.NET Objects<br /><ul><li> Various methods available in SqlConnection Object
  • 5. Open()
  • 6. Opens the connection to our database
  • 7. Close()
  • 8. Closes the database connection
  • 9. Dispose()
  • 10. Releases the resources on the connection object</li></li></ul><li>ADO.NET Objects<br /><ul><li>SqlCommand
  • 11. Used to execute commands to a database across a data </li></ul>connection<br /><ul><li>Send SQL statements to the database to perform certain action
  • 12. What type of interaction you want to perform with a database</li></ul>Select<br />Insert<br />Delete<br />Update<br />SqlConnectioncon=new SqlConnection(“Data Source=(local);Initial <br /> Catalog=Master; Integrated Security=SSPI”);<br />Con.Open();<br />SqlCommandcmd=newSqlCommand(“select * from student”,con);<br />Con.Close();<br />
  • 13. ADO.NET Objects<br /><ul><li> Various Methods Available in SqlCommand Object
  • 14. ExecuteNonQuery()
  • 15. Expects to run a command or a stored procedure
  • 16. ExecuteScalar()
  • 17. Returns only one value after executing the query
  • 18. ExecuteReader()
  • 19. Expects to run a query command or a stored procedure </li></ul>that SELECTS records<br />
  • 20. ADO.NET Objects<br /><ul><li>SqlDataReader
  • 21. Provides a forward-only, read-only, connected stream record set </li></ul>from a database<br /><ul><li>Returned as the result of the Commandobject's ExecuteReader()</li></ul>SqlCommandcmd=new SqlCommand(“select * from student” , con);<br /> <br />SqlDataReaderre=cmd . ExecuteReader();<br />
  • 22. ADO.NET Objects<br /><ul><li> Basic Methods available in SqlDataReader Object
  • 23. Read()
  • 24. Used to move the Record Pointer to the first row which </li></ul>allows the data to be read by the column name or the index <br /> position <br /><ul><li>HasRow()
  • 25. Checks if any data exists, and it is used instead of the Read()
  • 26. Close()
  • 27. Used to close the SqlDataReader()</li>

×