I. Binding the drop box data
String sql = "SELECT * from Grade";
SqlDataAdapter SDA = new SqlDataAdapter (Sql,helper. Con);
Sda. Fill (ds, "Grade");
Create a new drop-down box option
DataRow row = this.ds.tables["Grade"]. NewRow ();
Row[0] =-1;
ROW[1] = "Please select";
this.ds.tables["Grade"]. Rows.insertat (row,0);
Tied Down Frame
This.cbograde.datasource=ds. tables["Grade"];
This.cbograde.displaymember= "Gradename";
This.cbograde.valuemember= "Gradeid";
Two. Binding Datagradeview data
Search by Grade Gradeid
String sql = "SELECT * from Student where gradeid= '" + this.cbograde.SelectedValue + "'";
Try
{
STUDENTSDA = new SqlDataAdapter (SQL, Helper. Con);
if (ds. tables["Student"]! = null) {
Ds. tables["Student"]. Clear ();
}
Studentsda. Fill (ds, "Student");
Binding data sources and Datagradeview
This.dgvStudent.DataSource = ds. tables["Student"];
}
catch (Exception x)
{
MessageBox.Show (X.message);
}
Three. Implementing Data Updates
DialogResult result=messagebox.show ("OK to change information?") "," hint ", messageboxbuttons.yesno,messageboxicon.information);
if (result = = Dialogresult.yes) {
SqlCommandBuilder SCB = new SqlCommandBuilder (STUDENTSDA);
Studentsda. Update (ds, "Student");
}
Parsing----------using Windows to implement data binding