Bca Chapter 10 - Ado - Net With Database
Bca Chapter 10 - Ado - Net With Database
• Insertion:
– INSERT INTO table_name VALUES (value1,value2…);
– Eg : INSERT INTO stud VALUES(101,’rani’);
INSERT INTO stud VALUES(102,’mala’);
• Displaying :
– SELECT * FROM table_name;
– Eg : SELECT * FROM stud;
• Deleting :
– DELETE FROM table_name WHERE conditions;
– Eg : DELETE FROM stud WHERE sno=101;
• Modifying:
– UPDATE table_name SET col_names=new_values WHERE
conditions;
– Eg : UPDATE stud SET sno=103, sname=‘priya’ WHERE sno=102
Special Features of ADO.Net
• Usage of XML to transmit data
• Improved performance and maintenance
S.No ADO ADO.Net
2. Record Set – has only single table Record Set – retrieves data from multiple tables
3. Sequential Access is only available Any kind of Access – can move to any record
dynamically
4. Client Side cursor only - Both Client and Server Side cursors –
MoveNext() method MoveNext(), MovePrev(), MoveFirst(),
MoveLast() methods
5. Based on COM – Component Obj Based on CLR – Common Lang Runtime
Modeling
6. Stores data in Binary Format Stores data in XML format (parsing of data)
sel = ComboBox1.SelectedIndex
TextBox1.Text = mydset.Tables(0).Rows(sel).Item(0).ToString()
TextBox2.Text = mydset.Tables(0).Rows(sel).Item(1).ToString()
TextBox3.Text = mydset.Tables(0).Rows(sel).Item(2).ToString()
TextBox4.Text = mydset.Tables(0).Rows(sel).Item(3).ToString()
TextBox5.Text = mydset.Tables(0).Rows(sel).Item(4).ToString()
TextBox6.Text = Integer.Parse(TextBox3.Text) +
Integer.Parse(TextBox4.Text) + Integer.Parse(TextBox5.Text)
XML & ADO.Net
• Imports System.Data
• Imports System.Xml
• Imports System.Io