1 / 17

עבודה עם נתונים באמצעות ADO.NET

עבודה עם נתונים באמצעות ADO.NET. MCSD Doron Amir. www . dorronamir . com. מהו ניהול נתונים ?. ניהול נתונים : שליפה , עריכה ,עדכון , מחיקה , בחירה וכו' של נתונים ממסד נתונים ( קובץ נתונים ). Disconnected Data Architecture. Application. DB.

coyne
Download Presentation

עבודה עם נתונים באמצעות ADO.NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. עבודה עם נתונים באמצעות ADO.NET MCSD Doron Amir www . dorronamir . com

  2. מהו ניהול נתונים ? ניהול נתונים : שליפה , עריכה ,עדכון , מחיקה , בחירה וכו' של נתונים ממסד נתונים ( קובץ נתונים ). Disconnected Data Architecture Application DB ADO.NET מבוססת על ארכיטקטורת נתונים מנותקת כך שהחיבור למסד הנתונים יהיה קצר ביותר למטרות שליפה ועדכון נתונים.

  3. מהם רכיבי ה -? ADO.NET DataSet Data Provider Connection Data Adapter DataReletion SelectCommand Command DB DataTable InsertCommand DataReader UpdateCommand DeleteCommand XML

  4. רכיבי ה – ADO.NET DataTable : אובייקט המייצג טבלה . DataSet :1(מכיל אוסף אחד או יותר של אובייקטים מסוג DataTable 2( מכיל מידע לגבי היחסים בין הטבלאות ב- DataRelation Objects Data Provider : מספק רכיבים המאפשרים התקשרות ועבודה מול המסד נתונים . ישנם שני ספקים מוכנים עבור מסדי נתונים. 1) עבור מסדי נתונים מסוג OleDb 2 ) עבור מסדי נתונים מסוג SQL Server

  5. DataTable 0 1 2 1112 Moshe Levi 1113 Sarit Mor 1114 Lilah Tibon

  6. DataSet 0 1 2 1:1 1112 Moshe Levi DataReletion 1113 Sarit Mor 1114 Lilah Tibon DataTable(1) 0 1 2 1112 23 Tel-Aviv 1113 32 Haifa 1114 20 ramat gan DataTable(2)

  7. Data Provider Connection : מייצג את הקשר למסד הנתונים Command : מייצג פקודה הנשלחת למסד הנתונים לצורך אחזור או עדכון נתונים. DataAdapter : מאפשר עבודה נוחה וקלה עם ה DataSet מול ה DataBase DataReader : מאפשר שליפה מהירה של נתונים אך לא ע"פ Disconnected System.Data.OleDb : הספרייה המספקת את המימוש עבור מסדי OleDb System.Data.SqlClient : הספרייה המספקת את המימוש עבור SQL Server Data Provider Data Adapter DataSet SelectCommand DataReader InsertCommand DataReletion Command UpdateCommand DataTable DeleteCommand Connection

  8. Data Reader ה- DataReader משמש לקרוא נתונים בכיוון אחד בלבד אין העתק של הנתונים בזיכרון , בכל רגע נתון יש בזיכרון רשומה בודדת Customers

  9. Why Command ? כאשר רוצים לבצע פעולות פשוטות ישירות מול מסד הנתונים ExecuteNonQuery Method : ביצוע פקודה שאיננה שאילתה הוספת שורה ישירות למסד הנתונים ע"י פקודת INSERT

  10. Why Command ? ExecuteScalar Method : שליפת נתון בודד ממסד הנתונים

  11. Data Adapter Data Adapter : מתווך בין מסד הנתונים לאובייקט ה DataSet Fill Method : שיטה זו מפעילה את התכונה SelectCommand • תכונות ה Data Adapter : • SelectCommand :משפטי בחירה ממסד הנתונים(Fill Method) • InsertCommand: פקודות ביצוע ( Update Method ) • DeleteCommand : פקודות ביצוע( Update Method ) • : UpdateCommand פקודות ביצוע( Update Method )

  12. Data Adapter Data Set Update Fill Data Adapter SelectCommand DB DeleteCommand UpdatetCommand InsertCommand

  13. Disconnected

  14. Typed DataSet dataSet.Tables[0].Rows[1][1]; Regular הטבלה הראשונה שורה (2) עמודה (2) id name age 0,0 0,1 0,2 1,0 1,1 1,2 2,0 2,1 2,2 dataSet.Customers[1].Name Typed שם הטבלה שורה (2) עמודה (2)

  15. Typed DataSet

  16. Code

  17. עבודה עם נתונים באמצעות ADO.NET

More Related