Multiple Document Interface MDI v MDI Form MDI

  • Slides: 32
Download presentation

Multiple Document Interface (MDI) v ���������� (MDI Form ) ���� MDI Child ����������� v

Multiple Document Interface (MDI) v ���������� (MDI Form ) ���� MDI Child ����������� v ���� SDI (Single document Interface) ���� Windows Explorer, Notepad etc. . . ����� 1 window ����������� 2

��������� child form private void MDIParent 1_Load(object sender, Event. Args e){ n // Create

��������� child form private void MDIParent 1_Load(object sender, Event. Args e){ n // Create a new instance of the child form. n Form 1 child. Form = new Form 1(); n // Make it a child of this MDI form before showing it. n child. Form. Mdi. Parent = this; n child. Form. Text = "·�Êͺ child form "; n child. Form. Show(); n 4

���� try…catch 1. 2. 3. 4. 5. 6. 7. 8. byte x=99; try {

���� try…catch 1. 2. 3. 4. 5. 6. 7. 8. byte x=99; try { x = byte. Parse("500"); } catch (System. Overflow. Exception ex) { x=0; lbl. Result. Text = ex. Message; } finally { lbl. Result. Text = "value is " + x; } 8

�������� �� n n 1. 2. 3. Message To. String ( ) … catch

�������� �� n n 1. 2. 3. Message To. String ( ) … catch (System. Overflow. Exception ex) { … 4. lbl. Result. Text = ex. Message ; 5. lbl. Result. Text = ex. To. String ( ) ; 6. 7. } … 9

throw new Exception ("������� ") ; n ������������ n … catch (System. Overflow. Exception

throw new Exception ("������� ") ; n ������������ n … catch (System. Overflow. Exception ex) { … throw new Exception (“Error”); } … 10

Ole. Db. Connection class(��� ) Constructor Ole. Db. Connectio() Ole. Db. Connectio(string) string :

Ole. Db. Connection class(��� ) Constructor Ole. Db. Connectio() Ole. Db. Connectio(string) string : ������������� Method ����� Open() Close() ������������ 12

Ole. Db. Connection class(��� ) String str. My. Provider = “Provider=Microsoft. JET. OLEDB. 4.

Ole. Db. Connection class(��� ) String str. My. Provider = “Provider=Microsoft. JET. OLEDB. 4. 0; " + "Data Source=C: \Northwind. mdb”; Ole. Db. Connection my. Connection = new Ole. Db. Connection(str. My. Connection); 13

Ole. Db. Command class ��������� SQL ���� Store. Procedure Property ������������� Command. Text Command.

Ole. Db. Command class ��������� SQL ���� Store. Procedure Property ������������� Command. Text Command. Time. Out Command. Type ������� SQL ���� Store. Procedure �������������� ����������� Command. Text 14

Ole. Db. Command class(��� ) Constructor Ole. Db. Command() Ole. Db. Command(string , Ole.

Ole. Db. Command class(��� ) Constructor Ole. Db. Command() Ole. Db. Command(string , Ole. Db. Connection) string : ������ SQL ���� Store. Procedure Ole. Db. Connection : ������� �� Ole. Db. Command(string , Ole. Db. Connection , Ole. Db. Transaction) 15

Ole. Db. Command class(��� ) string my. Insert. Query = "INSERT INTO Customers (Customer.

Ole. Db. Command class(��� ) string my. Insert. Query = "INSERT INTO Customers (Customer. ID, Company. Name) Values(‘ 001', ‘Jame Bonds')"; Ole. Db. Command my. Command = new Ole. Db. Command(my. Insert. Query); my. Command. Connection = my. Connection; string my. Query = “SELECT * FROM Customers“ my. Adapter. Select. Command = new Ole. Db. Command(my. Query, my. Connection); 16

Ole. Db. Data. Adapter class ������������������� Constructor �������� Data. Set ��� update Ole. Db.

Ole. Db. Data. Adapter class ������������������� Constructor �������� Data. Set ��� update Ole. Db. Data. Adapter() Data Source Ole. Db. Data. Adapter(Ole. Db. Comm and) Ole. Db. Data. Adapter(string , Ole. Db. Connection) Ole. Db. Data. Adapter(String , String) 17

Ole. Db. Data. Adapter class(��� ) Property ����� Insert. Command ������ SQL ���� Strore.

Ole. Db. Data. Adapter class(��� ) Property ����� Insert. Command ������ SQL ���� Strore. Procedure ����������� Data Source Delete. Command ������ SQL ���� Strore. Procedure �������� Data Source Method ����� Update. Command ������ SQL ���� Fill ����� (refresh) Strore. Procedure ���� Data. Set Update ���� (refresh) ���� Data. Set ����������� 18 Data Source

Ole. Db. Data. Adapter class(��� ) Ole. Db. Data. Adapter my. Adapter = new

Ole. Db. Data. Adapter class(��� ) Ole. Db. Data. Adapter my. Adapter = new Ole. Db. Data. Adapter(); my. Adapter. Fill(dataset); return dataset; 19

Ole. Db. Data. Reader class ���������� Forward-only �������� Data Source (������� 1 ���� )

Ole. Db. Data. Reader class ���������� Forward-only �������� Data Source (������� 1 ���� ) Constructor Ole. Db. Data. Reader() Ole. Db. Data. Reader(Ole. Db. Command) Ole. Db. Data. Reader(string , Ole. Db. Connection) Ole. Db. Data. Reader(String , String) 20

Data. Set class ���������� Ole. Db. Data. Adapter Constructor Data. Set() Data. Set(string) Data.

Data. Set class ���������� Ole. Db. Data. Adapter Constructor Data. Set() Data. Set(string) Data. Set(Serialization. Info , Streaming. Context , Boolean) String : ������� Data. Set Infrastructure 22

�������� (Binding Data) n ���������� Binding. Source n ���� Binding. Source my. Biding =

�������� (Binding Data) n ���������� Binding. Source n ���� Binding. Source my. Biding = new Binding. Source() Property ����� Data. Source Count Item Position ���������������� � ���������������� Item 30