问题描述
3)PleasedescribeimplementationmethodoftheclassDBPersistwithClassDataSetandOleDbAdapter.OpenMethod:SaveMethod:4)TherearecontrolsinfrmCompany.aspxasfollows:TextBoxtxtCompanyIDTextBoxtxtCompanyNameButtonbtnSave;PleasewritethebtnSave’sonclickmethod.ThemethodcallclassDBPerist.BtnSave_Onclick(){}
解决方案
解决方案二:
E文的啊~~晕
解决方案三:
3)OleDbAdapteradapter=newOleDbAdapter(newOleDbCommand());DataSetds=newDataSet();adapter.fill(ds);4)BtnSave_Onclick(){Stringstr1=txtCompanyID.Text.ToString();Stringstr2=txtCompanyName.Text.ToString();OleDbConnectionconn=newOleDbConnection(ConnStr);conn.Open();OleDbCommandcommand=newOleDbCommand("insertintotable1values('"+str1+"','"+str2+"')");command.ExcecuteNonQuery();}
解决方案四:
callclassDBPerist应该把第三题封装一个类吧,建立类的对象来调用DBPerist方法
时间: 2024-09-16 04:23:05