protected void Insert_record ( object sender , System.EventArgs e )
{
try
{
file://判断所有字段是否添完,添完则执行,反之弹出提示 
if ( t_id.Text != "" && t_xm.Text != "" && t_xb.Text != "" && t_nl.Text != "" && t_books.Text != "" )
{
string myConn1 = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = db.mdb" ;
OleDbConnection myConn = new OleDbConnection ( myConn1 ) ;
myConn.Open ( ) ;
string strInsert = " INSERT INTO person ( id , xm , xb , nl , zip ) VALUES ( " ;
strInsert += t_id.Text + ", '" ;
strInsert += t_xm.Text + "', '" ;
strInsert += t_xb.Text + "', " ;
strInsert += t_nl.Text + ", " ;
strInsert += t_books.Text + ")" ;
OleDbCommand inst = new OleDbCommand ( strInsert , myConn ) ;
inst.ExecuteNonQuery ( ) ;
myConn.Close ( ) ;
myDataSet.Tables [ "person" ] . Rows [ myBind.Position ] . BeginEdit ( ) ;
myDataSet.Tables [ "person" ] . Rows [ myBind.Position ] . EndEdit ( ) ;
myDataSet.Tables [ "person" ] . AcceptChanges ( ) ;
}
else
{
MessageBox.Show ( "必须填满所有字段值!" , "错误!" ) ;
}
}
catch ( Exception ed )
{
MessageBox.Show ( "保存数据记录发生 " + ed.ToString ( ) , "错误!" ) ;

}