锘??xml version="1.0" encoding="utf-8" standalone="yes"?> A colleague recently asked me a question: "I'm modifying the data type of a column. When doing so I get the following error: ORA-54033: column to be modified is used in a virtual column expression But there's no virtual columns defined on the table! What on earth's going on?!" This was exceptionally confusing. Looking at the table definition we couldn't see any virtual columns defined: Sure enough, when we tried to change the data type of y we got the exception: How could this be? Perhaps there was a column defined that we couldn't see. Querying user_tab_cols revealed something interesting: The SYS_... column isn't in the table DDL! Where does it come from? And what's SYS_OP_COMBINED_HASH all about? Has someone been mucking around with the database? The SYS_ prefix is a sign that the column is system generated. So something's happened that's caused Oracle to create this on our behalf. SYS_OP_COMBINED_HASH is an undocumented feature. The name implies Oracle is merging the arguments together to form a hash. Is there a feature where we want to capture information about a group of columns? Indeed there is -extended statistics!This feature enables to Oracle calculate statistics on a group of columns. It uses this information to improve row estimates. This is useful when there's a correlation between the values of two (or more) columns in a table. Someone had created extended stats on this table for (x, y). Now we've identified the problem, how do we get around it? Simple: drop and recreate the extended stats: Success! Extended stats are a great way to improve the optimizer's row estimates. If you need to create these, I recommend you also do the following: 鏂規(guī)硶涓錛?/p>
鏂規(guī)硶浜岋細(xì) Easyui Tree涓鐩村氨娌℃湁鎻愪緵榪欎釜鏂規(guī)硶,浠ュ墠娌℃湁鐢ㄥ埌,鎵浠ヤ竴鐩存病鎬庝箞鍦ㄦ剰,榪欐鑷繁鐢ㄥ埌浜?欏轟究鎵╁睍浜嗕竴涓柟娉?鍒嗕韓緇欏ぇ瀹? 鍗佽繘鍒?->鍗佸叚榪涘埗 鍗佸叚榪涘埗-->鍗佽繘鍒?br />select to_number('7D','XX') from dual; 鍙傛暟榛樿鍊兼槸鎸囧湪璋冪敤鍑芥暟鏃訛紝鑻ョ渷鐣ヤ簡鏌愪釜瀹炲弬錛屽嚱鏁頒細(xì)鑷姩涓鴻鍙傛暟鍒嗛厤涓涓粯璁ゅ鹼紝浣垮緱鍑芥暟璋冪敤鐨勬柟渚挎у拰鐏墊椿鎬уぇ澶ф彁楂樸?/p>
涓句釜渚嬪瓙錛屾瘮濡?a style="color: rgb(51,51,51); font-size: 14px; text-decoration: none" class="keylink" target="_blank">PHP涓殑瀛楃涓叉埅鍙栧嚱鏁皊ubstr(string,start,length)錛屽綋涓嶆寚瀹歭ength鏃訛紝鍑芥暟灝嗛粯璁ゆ埅鍙栧瓧絎︿覆涓璼tart浣嶇疆鍒板瓧絎︿覆緇撴潫錛岃屽鏋滄寚瀹氫簡length錛屽垯鎴彇浠巗tart浣嶇疆寮濮嬬殑浠ength涓洪暱搴︾殑瀛楃涓詫紝鎵浠ュ鏋滆皟鐢ㄧ殑鏄痵ubstr('http://www.hualai.net.cn',11,6)錛屽垯榪斿洖鐨勬槸hualai錛涘鏋滅渷鐣ユ帀鏈鍚庝竴涓弬鏁幫紝substr('http://www.hualai.net.cn',11)錛屽垯榪斿洖hualai.net.cn銆?/p>
鍐嶆瘮濡俲Query妗嗘灦涓紝$(selector).html()鏂規(guī)硶鏄幏鍙栬鍏冪礌鍐呯殑HTML浠g爜錛岃?(selector).html(content)鍒欐槸璁劇疆璇ュ厓绱犲唴鐨凥TML銆傛垜浠煡閬擄紝鍦–璇█涓紝鎴戜滑鍙互閫氳繃濡備笅褰㈠紡鏉ヤ負(fù)鍑芥暟鍙傛暟璁劇疆榛樿鍊鹼細(xì) [cpp] [java] [js] [js] [js] 鎰熻榪欎釜CTE閫掑綊鏌ヨ铔ソ鐢ㄧ殑錛屽厛涓句釜渚嬪瓙錛?/p>
涓婇潰鐨凷QL璇彞鍐嶆鎻掑叆涓鏉℃暟鎹細(xì) insert Tree values('緗戠粶1鐝?,'緗戠粶宸ョ▼') 榪愯緇撴灉濡備笅鍥撅細(xì) 鍥? 榪愯緇撴灉 娉ㄦ剰鐐癸細(xì)璨屼技鍦ㄩ掑綊鎴愬憳澶勬墍閫夋嫨鐨勫瓧孌甸兘蹇呴』Tree琛ㄧ殑鏁版嵁錛岃屼笉鑳芥槸CTE緇撴灉闆嗕腑鐨勯櫎浜員ree涓病鏈夎孋TE涓湁鐨勫瓧孌靛湪榪欓噷鎵嶅彲浠ュ紩鐢紝姣斿瀛楁TE銆?/p>
棣栧厛鐪嬩笅錛岄亶鍘嗙殑絎?鏉¤褰曠殑SQL璇彞錛?/p>
鑾峰彇鐨勭粨鏋滀負(fù)錛?/p>
Name Parent TE Levle ------------------------------------- 澶у NULL 澶у 0 閫掑綊絎?嬈℃墍鑾峰彇鐨勭粨鏋滈泦鍚堢殑綾籗QL璇彞涓猴細(xì) 涓婇潰鐨凜TE瀛愭煡璇㈢殑緇撴灉灝辨槸絎竴嬈¢掑綊鏌ヨ鐨勭粨鏋滈泦錛屼笂闈QL榪愯緇撴灉涓猴細(xì) 鍚屾牱鐨勶紝灝嗙浜屾閫掑綊鏌ヨ鐨勪笂闈笁鏉¤褰曚綔涓虹涓夋鏌ヨ鐨?#8216;瀹氫綅鎴愬憳’錛?/p>
銆愯繖閲岃娉ㄦ剰錛屼笂闈㈢殑涓夋潯璁板綍鏄粠鏈鍚庝竴鏉″紑濮嬩緷嬈′綔涓虹涓夋閫掑綊鐨勮緭鍏ョ殑錛屽嵆絎竴鏉℃槸ID=9鐨勮褰曪紝鎺ヤ笅鏉ユ槸7鍜?錛屽叧浜庣鍥涙閫掑綊涔熺被浼箋?/p>
絎笁嬈¢掑綊綾籗QL璇彞 緇撴灉濡備笅錛?/p>
鍏跺疄姣忔閫掑綊鐨勭被SQL鍙負(fù)濡備笅鎵紺猴細(xì) 絎洓嬈¢掑綊涓嬈$被鎺紝鏈鍚庢墍鏌ヨ鐨勭粨鏋滀負(fù)涓婇潰鎵鏈夐掑綊鐨剈nion銆?/p>
緇細(xì)鍦ㄤ笂闈㈢殑SQ璇彞鏌ヨ緇撴灉涓紝ID涓?0鐨勮褰曞簲璇ヨ鏀懼湪ID涓?鐨勫悗闈€?/p>
寰鏁版嵁琛ㄤ腑鍐嶆娣誨姞涓ゆ潯璁板綍錛?/p>
insert Tree values('璁$','璁$畻鏈哄闄?) 鍐嶆淇敼涓婇潰鐨凷QL璇彞錛?/p>
鏈鍚庣殑緇撴灉涓猴細(xì) 鍥? 榪愯緇撴灉 榪欐牱錛屾棤璁虹敤鎴鋒彃鍏ュ灝戞潯璁板綍閮藉彲浠ヨ繘琛屾寜閮ㄩ棬錛屾寜瑙勫緥榪涜鏌ヨ銆?/p> BLL灞?nbsp; public void Update(DataTable dt) dal.Update(dt); DAL灞?/p>
public void Update(DataTable dt) adapter.InsertCommand = new SqlCommand("INSERT INTO dbo.t6( com_id ,usr_id ) VALUES( @com_id ,@usr_id)", conn); adapter.UpdateCommand = new SqlCommand("update t6 setwhereand usr_id", conn); adapter.DeleteCommand = new SqlCommand("delete from t6 whereand usr_id", conn); adapter.DeleteCommand.Parameters["@com_id"].SourceVersion = DataRowVersion.Original; adapter.Update(dt); 鍓嶅彴 public partial class DataTableUpdate : Form public BLL.Users Bu = new BLL.Users(); public string _UserId = ""; public DataTableUpdate() //紿楀彛鍔犺澆 private void Form1_Load(object sender, EventArgs e) private void BindValue() //鎵嬪姩淇敼鍙互; 浠g爜璧嬪奸渶瑕佺敤涓嬮潰榪欏彞璇?br /> tb_UsrId.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged; private void 淇濆瓨_Click(object sender, EventArgs e) private void 鍒犻櫎_Click(object sender, EventArgs e) if (dataGridView1.CurrentCell == null) try private void 澧炲姞_Click(object sender, EventArgs e) private void 鍙栨秷_Click(object sender, EventArgs e) 鏈妭鍐呭 灝嗘暟鎹坊鑷寵〃涓?/font>:璇存槑濡備綍鍒涘緩鏂拌騫跺皢鍏舵坊鑷寵〃涓?/p>
浠ヤ笅紺轟緥婕旂ず浜嗗浣曢氳繃璋冪敤 NewRow 鏂規(guī)硶鏉ュ垱寤烘柊琛屻?/p>
DataRow workRow = workTable.NewRow(); 鐒跺悗鎮(zhèn)ㄥ彲浠ヤ嬌鐢ㄧ儲(chǔ)寮曟垨鍒楀悕鏉ユ搷浣滄柊娣誨姞鐨勮錛屽涓嬩緥鎵紺恒?/p>
workRow["CustLName"] = "Smith"; 鍦ㄥ皢鏁版嵁鎻掑叆鏂拌鍚庯紝Add 鏂規(guī)硶鍙敤浜庡皢琛屾坊鑷?span class="Apple-converted-space"> DataRowCollection錛屽浠ヤ笅浠g爜鎵紺恒?/p>
workTable.Rows.Add(workRow); 鎮(zhèn)ㄤ篃鍙互閫氳繃浼犲叆鍊肩殑鏁扮粍錛堢被鍨嬪寲涓?span class="Apple-converted-space"> Object錛夛紝璋冪敤 Add 鏂規(guī)硶鏉ユ坊鍔犳柊琛岋紝濡備笅渚嬫墍紺恒?/p>
workTable.Rows.Add(new Object[] {1, "Smith"}); 灝嗙被鍨嬪寲涓?span class="Apple-converted-space"> Object 鐨勫肩殑鏁扮粍浼犻掑埌 Add 鏂規(guī)硶錛屽彲鍦ㄨ〃鍐呭垱寤烘柊琛屽茍灝嗗叾鍒楀艱緗負(fù)瀵硅薄鏁扮粍涓殑鍊箋傝娉ㄦ剰錛屾暟緇勪腑鐨勫間細(xì)鏍規(guī)嵁瀹冧滑鍦ㄨ〃涓嚭鐜扮殑欏哄簭鐩哥戶涓庡悇鍒楀尮閰嶃?/p>
浠ヤ笅紺轟緥灝嗗崄琛屾坊鑷蟲柊寤虹殑 Customers 琛ㄤ腑銆?/p>
DataRow workRow; 鏌ョ湅琛ㄤ腑鏁版嵁:璇存槑濡備綍璁塊棶琛屼腑鐨勬暟鎹紝鍖呮嫭鏁版嵁鐨勫師濮嬬増鏈拰褰撳墠鐗堟湰銆?/p>
DataTable 瀵硅薄鐨?span class="Apple-converted-space"> Select 鏂規(guī)硶榪斿洖涓緇勪笌鎸囧畾鏉′歡鍖歸厤鐨?span class="Apple-converted-space"> DataRow 瀵硅薄銆?strong>Select 閲囩敤絳涢夎〃杈懼紡銆佹帓搴忚〃杈懼紡鍜?span class="Apple-converted-space"> DataViewRowState 鐨勫彲閫夊弬鏁般傜瓫閫夎〃杈懼紡鏍規(guī)嵁 DataColumn 鍊鹼紙渚嬪 Select 鏂規(guī)硶鍩轟簬 DataViewRowState 紜畾瑕佹煡鐪嬫垨鎿嶄綔鐨勮鐨勭増鏈備笅琛ㄨ鏄庝簡鍙兘鐨?span class="Apple-converted-space"> DataViewRowState 鏋氫婦鍊箋?/p>
鍦ㄤ笅闈㈢殑紺轟緥涓紝DataSet 瀵硅薄宸茬粡榪囩瓫閫夛紝榪欐牱錛屾?zhèn)ㄥ彲浠ュ彧鋴社敤鍏?span id="plhrtxb" class="Apple-converted-space"> DataViewRowState 璁劇疆涓?span class="Apple-converted-space"> CurrentRows鐨勮銆?/p>
DataRow[] currRows = workTable.Select(null, null, DataViewRowState.CurrentRows); Select 鏂規(guī)硶鍙敤浜庤繑鍥炲叿鏈変笉鍚?span class="Apple-converted-space"> RowState 鍊兼垨瀛楁鍊肩殑琛屻備互涓嬬ず渚嬭繑鍥炰竴涓紩鐢ㄦ墍鏈夊凡鍒犻櫎琛岀殑 DataRow鏁扮粍錛屽茍榪斿洖鍙︿竴涓紩鐢ㄦ墍鏈夊凡鎺掑簭琛岋紙鎸夌収 CustLName 鎺掑簭錛屽叾涓?span class="Apple-converted-space"> CustID 鍒楀ぇ浜?5錛夌殑 DataRow 鏁扮粍銆?/p>
// Retrieve all deleted rows. 緙栬緫琛ㄤ腑鐨勬暟鎹?/font>:璇存槑濡備綍淇敼琛屼腑鐨勬暟鎹紝鍖呮嫭鎸傝搗瀵硅鐨勬洿鏀癸紝鐩磋嚦楠岃瘉騫舵帴鍙椾簡寤鴻鐨勬洿鏀廣?/p>
褰撴?zhèn)ㄧ洿鎺ュ?span class="Apple-converted-space"> DataRow 涓慨鏀瑰垪鍊兼椂錛?strong>DataRow 浼?xì)鋴社?span class="Apple-converted-space"> Current銆?strong>Default 鍜?span class="Apple-converted-space"> Original 琛岀増鏈潵綆$悊鍒楀箋傞櫎榪欎簺琛岀増鏈互澶栵紝BeginEdit銆?strong>EndEdit 鍜?span class="Apple-converted-space"> CancelEdit 鏂規(guī)硶榪樹嬌鐢ㄧ鍥涗釜琛岀増鏈細(xì)Proposed銆?/p>
鍦ㄦ墽琛岀紪杈戞搷浣滐紙閫氳繃璋冪敤 BeginEdit 寮濮嬶紝騫朵笖閫氳繃浣跨敤 EndEdit 鎴?span class="Apple-converted-space"> CancelEdit 鎴栬呴氳繃璋冪敤AcceptChanges 鎴?span class="Apple-converted-space"> RejectChanges 緇撴潫錛夌殑榪囩▼涓紝Proposed 琛岀増鏈細(xì)瀛樺湪銆?/p>
鍦ㄧ紪杈戞搷浣滆繃紼嬩腑錛屾?zhèn)ㄥ彲浠ラ氳繃璁$畻 DataTable 鐨?span class="Apple-converted-space"> ColumnChanged 浜嬩歡涓殑 ProposedValue 鏉ュ皢楠岃瘉閫昏緫搴旂敤浜庡悇鍒椼?strong>ColumnChanged 浜嬩歡淇濆瓨 DataColumnChangeEventArgs錛屽彲淇濇寔瀵規(guī)鍦ㄦ洿鏀圭殑鍒楀拰ProposedValue 鐨勫紩鐢ㄣ傝綆椾簡寤鴻鍊煎悗錛屽彲浠ュ鍏惰繘琛屼慨鏀規(guī)垨鍙栨秷緙栬緫銆傜紪杈戠粨鏉熸椂錛岃浠?span class="Apple-converted-space"> Proposed 鐘舵佷腑縐誨嚭銆?/p>
鎮(zhèn)ㄥ彲浠ラ氳繃璋冪敤 EndEdit 鏉ョ‘璁ょ紪杈戯紝涔熷彲浠ラ氳繃璋冪敤 CancelEdit 鏉ュ彇娑堢紪杈戙傝娉ㄦ剰錛屽敖綆?span class="Apple-converted-space"> EndEdit 紜疄宸茬‘璁ゆ?zhèn)ㄦ墍鍋氱殑緙栬緫錛屼絾鍦ㄨ皟鐢?span class="Apple-converted-space"> AcceptChanges 涔嬪墠錛?strong>DataSet 騫舵病鏈夊疄闄呮帴鍙楁洿鏀廣傚彟澶栬娉ㄦ剰錛屽鏋滃湪EndEdit 鎴?span class="Apple-converted-space"> CancelEdit 緙栬緫緇撴潫涔嬪墠璋冪敤 AcceptChanges錛岀紪杈戝皢浼?xì)缁堟锛岒q舵帴鍙?span class="Apple-converted-space"> Current 鍜?span class="Apple-converted-space"> Original 琛岀増鏈殑 Proposed 琛屽箋傝皟鐢?span class="Apple-converted-space"> RejectChanges 浼?xì)浠ュ悓鏍风殑鏂瑰紡缁撴潫缂栬緫锛岒q舵斁寮?span class="Apple-converted-space"> Current 鍜?span class="Apple-converted-space"> Proposed 琛岀増鏈傚湪璋冪敤 AcceptChanges 鎴?span class="Apple-converted-space"> RejectChanges 涔嬪悗璋冪敤 EndEdit 鎴?span class="Apple-converted-space"> CancelEdit 涓嶄細(xì)璧蜂綔鐢紝鍥犱負(fù)緙栬緫宸茬粡緇撴潫銆?/p>
浠ヤ笅紺轟緥婕旂ず浜嗗浣曞皢 BeginEdit 涓?span class="Apple-converted-space"> EndEdit 鍜?span class="Apple-converted-space"> CancelEdit 涓璧蜂嬌鐢ㄣ傛湰紺轟緥涔熶細(xì)媯(gè)鏌?span class="Apple-converted-space"> ColumnChanged 浜嬩歡涓殑 ProposedValue錛屽茍鍐沖畾鏄惁鍙栨秷緙栬緫銆?/p>
DataTable workTable = new DataTable(); 琛岀姸鎬佷笌琛岀増鏈?/font>:鎻愪緵鏈夊叧琛岀殑涓嶅悓鐘舵佺殑淇℃伅銆?/p>
姣忎釜 DataRow 瀵硅薄閮藉叿鏈?span class="Apple-converted-space"> RowState 灞炴э紝鎮(zhèn)ㄥ彲浠ユ鏌ユ灞炴ф潵紜畾琛岀殑褰撳墠鐘舵併備笅琛ㄧ粰鍑轟簡瀵瑰悇RowState 鏋氫婦鍊肩殑綆瑕佽鏄庛?/p>
瀵逛簬宸茬粡浣跨敤 Remove 鏂規(guī)硶錛堟垨鏄湪浣跨敤 Delete 鏂規(guī)硶涔嬪悗浣跨敤浜?span class="Apple-converted-space"> AcceptChanges 鏂規(guī)硶錛変粠DataRowCollection 涓Щ闄ょ殑琛岋紝涔熻緗負(fù) Detached銆?/p> 鍦?span class="Apple-converted-space"> DataSet銆?strong>DataTable 鎴?span class="Apple-converted-space"> DataRow 涓婅皟鐢?span class="Apple-converted-space"> AcceptChanges 鏃訛紝浼?xì)绉婚櫎琛岀姸鎬佷負(fù) Deleted 鐨勬墍鏈夎銆傚墿浣欑殑琛屼細(xì)琚祴浜?span class="Apple-converted-space"> Unchanged 琛岀姸鎬侊紝騫朵笖 Original 琛岀増鏈腑鐨勫間細(xì)鏀瑰啓涓?span class="Apple-converted-space"> Current 琛岀増鏈箋傝皟鐢?strong>RejectChanges 鏃訛紝浼?xì)绉婚櫎琛岀姸鎬佷負(fù) Added 鐨勬墍鏈夎銆傚墿浣欑殑琛屼細(xì)琚祴浜?span class="Apple-converted-space"> Unchanged 鐨勮鐘舵侊紝騫朵笖Current 琛岀増鏈腑鐨勫間細(xì)鏀瑰啓涓?span class="Apple-converted-space"> Original 琛岀増鏈箋?/p>
閫氳繃鐢ㄥ垪寮曠敤鏉ヤ紶閫?span class="Apple-converted-space"> DataRowVersion 鍙傛暟錛屾?zhèn)ㄥ彲浠ユ煡鐪嬭鐨勪笉鍚岃鐗堟湰锛屽涓嬩緥鎵紺恒?/p>
DataRow custRow = custTable.Rows[0]; 涓嬭〃緇欏嚭浜嗗悇 DataRowVersion 鏋氫婦鍊肩殑綆瑕佽鏄庛?/p>
閫氳繃璋冪敤 HasVersion 鏂規(guī)硶騫跺皢 DataRowVersion 浣滀負(fù)鍙傛暟浼犻掞紝鎮(zhèn)ㄥ彲浠ユ祴璇?span class="Apple-converted-space"> DataRow 鏄惁鍏鋒湁鐗瑰畾鐨勮鐗堟湰銆備緥濡傦紝鍦ㄨ皟鐢?span class="Apple-converted-space"> AcceptChanges 涔嬪墠錛?code class="ce">DataRow.HasVersion(DataRowVersion.Original) 瀵規(guī)柊娣誨姞鐨勮灝嗚繑鍥?span class="Apple-converted-space"> false銆?/p>
渚嬪錛屼互涓嬩唬鐮佺ず渚嬫樉紺轟簡琛ㄤ腑鎵鏈夊凡鍒犻櫎琛岀殑鍊箋傚凡鍒犻櫎鐨勮娌℃湁 Current 琛岀増鏈紝鍥犳鍦ㄨ闂垪鍊兼椂蹇呴』浼犻?span class="Apple-converted-space"> DataRowVersion.Original銆?/p>
DataTable catTable = catDS.Tables["Categories"]; 浠庤〃涓垹闄よ:璇存槑濡備綍浠庤〃涓Щ闄よ銆?/p>
鍦ㄥ皢 DataSet 鎴?span class="Apple-converted-space"> DataTable 涓?span class="Apple-converted-space"> DataAdapter 鍜屽叧緋誨瀷鏁版嵁婧愪竴璧蜂嬌鐢ㄦ椂錛岀敤 DataRow 鐨?span class="Apple-converted-space"> Delete 鏂規(guī)硶縐婚櫎琛屻?strong>Delete 鏂規(guī)硶鍙槸鍦?span class="Apple-converted-space"> DataSet 鎴?span class="Apple-converted-space"> DataTable 涓皢琛屾爣璁頒負(fù) Deleted錛岃屼笉浼?xì)绉婚櫎瀹冦傝?span class="Apple-converted-space"> DataAdapter 鍦ㄩ亣鍒版爣璁頒負(fù) Deleted 鐨勮鏃訛紝浼?xì)鎵ц鍏?span id="vlvfbnl" class="Apple-converted-space"> DeleteCommand 浠ュ湪鏁版嵁婧愪腑鍒犻櫎璇ヨ銆傜劧鍚庯紝灝卞彲浠ョ敤AcceptChanges 鏂規(guī)硶姘鎬箙縐婚櫎璇ヨ銆傚鏋滀嬌鐢?span class="Apple-converted-space"> Remove 鍒犻櫎璇ヨ錛屽垯璇ヨ灝嗕粠琛ㄤ腑瀹屽叏縐婚櫎錛屼絾DataAdapter 涓嶄細(xì)鍦ㄦ暟鎹簮涓垹闄よ琛屻?/p>
DataRowCollection 鐨?span class="Apple-converted-space"> Remove 鏂規(guī)硶閲囩敤 DataRow 浣滀負(fù)鍙傛暟錛屽茍灝嗗叾浠庨泦鍚堜腑縐婚櫎錛屽涓嬩緥鎵紺恒?/p>
workTable.Rows.Remove(workRow); 浣滀負(fù)瀵規(guī)瘮錛屼互涓嬬ず渚嬫紨紺轟簡濡備綍璋冪敤 DataRow 涓婄殑 Delete 鏂規(guī)硶鏉ュ皢鍏?span class="Apple-converted-space"> RowState 鏀逛負(fù) Deleted銆?/p>
workRow.Delete(); 濡傛灉灝嗚鏍囪涓哄垹闄わ紝騫朵笖璋冪敤 DataTable 瀵硅薄鐨?span class="Apple-converted-space"> AcceptChanges 鏂規(guī)硶錛岃琛屽氨浼?xì)浠?span id="htplhn3" class="Apple-converted-space"> DataTable 涓Щ闄ゃ傜浉姣斾箣涓嬶紝濡傛灉璋冪敤 RejectChanges錛岃鐨?span class="Apple-converted-space"> RowState 灝變細(xì)鎭㈠鍒拌鏍囪涓?span class="Apple-converted-space"> Deleted 涔嬪墠鐨勭姸鎬併?/p>
娣誨姞鍜岃鍙栬閿欒淇℃伅:璇存槑濡備綍鎸夎鎻掑叆閿欒淇℃伅錛屼互鐢ㄤ簬瑙e喅鏈夊叧搴旂敤紼嬪簭鍐呰涓暟鎹殑闂銆?/p>
DataTable workTable = new DataTable("Customers"); 鎺ュ彈鎴栨嫆緇濆琛岀殑鏇存敼:璇存槑濡備綍鎺ュ彈鎴栨嫆緇濆琛岀殑鏇存敼銆?/p>
濡傛灉 DataTable 涓婂瓨鍦ㄥ閿害鏉燂紝浣跨敤 AcceptChanges 鍜?span class="Apple-converted-space"> RejectChanges 鎺ュ彈鎴栨嫆緇濈殑鏇存敼灝變細(xì)鏍規(guī)嵁ForeignKeyConstraint.AcceptRejectRule 浼犳挱鑷?span class="Apple-converted-space"> DataRow 鐨勫瓙琛屻?/p>
浠ヤ笅紺轟緥媯(gè)鏌ユ湁閿欒鐨勮錛屽湪閫傜敤涔嬪瑙e喅閿欒錛屾嫆緇濇棤娉曡В鍐抽敊璇殑琛屻傝娉ㄦ剰錛屽浜庤В鍐崇殑閿欒錛?strong>RowError鍊間細(xì)閲嶇疆涓虹┖瀛楃涓詫紝瀵艱嚧灝?span class="Apple-converted-space"> HasErrors 灞炴ц緗負(fù) false銆傚綋瑙e喅鎴栨嫆緇濅簡鎵鏈夌殑鏈夐敊璇殑琛屾椂錛屽氨浼?xì)璋冪?strong>AcceptChanges 鏉ユ帴鍙楀鏁翠釜 DataTable 鐨勬墍鏈夋洿鏀廣?/p>
if (workTable.HasErrors) 澶勭悊 DataTable 浜嬩歡:鎻愪緵鍙敤浜?span class="Apple-converted-space"> DataTable 鐨勪簨浠剁殑鐩稿叧淇℃伅錛屽寘鎷慨鏀瑰垪鍊煎拰娣誨姞鎴栧垹闄よ鏃剁殑浜嬩歡銆?/p>
浠ヤ笅紺轟緥鍒涘緩 4 涓簨浠訛細(xì)OnColumnChanged銆?strong>OnColumnChanging銆?strong>OnRowChanged 鍜?strong>OnRowChanging銆傝繖浜涗簨浠朵腑鐨勬瘡涓涓兘鍦ㄥ垪鎴栬鏇存敼鏃跺彂鐢熴?/p>
workTable.ColumnChanged += new DataColumnChangeEventHandler(OnColumnChanged); @SQL=SELECT COALESCE(MAX(ColumnName),0)+10 AS DefaultValue FROM TableName WHERE xxParentColumn=@xxParentColumn@ The WHERE part of this clause needs to be replaced with the required values. The code that should appear here is the name of the column which links with the id of the parent one. For example, each record of the C_InvoiceLine belongs to a particular C_Invoice record and they are all sequenced. C_Invoice is the parent table for the lines saved in C_InvoiceLine. This table has a column named line and the default value that it takes is: @SQL=SELECT COALESCE(MAX(LINE),0)+10 AS DefaultValue FROM C_INVOICELINE WHERE C_INVOICE_ID=@C_INVOICE_ID@ The first option can be chosen if the original module author wants to
add more columns to his/her module. The second option is possible for
anyone as the columns are added by a new module to the existing one
which is not changed directly.
The main difference between these two methods is the names which
need to be chosen for the columns to comply with the modularity naming
rules.
In the Application Dictionary || Message window create a new record using the following details:
]]>
]]>
$bin/hadoop-daemon.sh start datanode
閲嶆柊balancer(鍙?
$bin/hbase-daemon.sh start master
]]>
public class FirstSparkSql {
public static void main(String[] args) {
String masterMode = "local";//spark://master:7077
SparkConf conf = new SparkConf();
//conf.set("spark.executor.memory", "1024m");
conf.setAppName("First Spark SQL");
conf.setMaster(masterMode);
//瑙e喅寮傚父錛?/span>IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI
conf.set("spark.sql.warehouse.dir","D:\\temp_files");
JavaSparkContext sc = new JavaSparkContext(conf);
SparkSession spark = SparkSession.builder().config(conf).getOrCreate();
Dataset<Row> df = spark.read().json("hdfs://master:9000/user/spark/input/persons.txt");
df.show();
sc.stop();
}
}
]]>
create table tab (
x integer,
y date,
z varchar2(30)
);
alter table tab modify (y timestamp);
ORA-54033: column to be modified is used in a virtual column expression
select column_name, data_default, hidden_column
from user_tab_cols
where table_name = 'TAB';
COLUMN_NAME DATA_DEFAULT HID
------------------------------ ----------------------------- ---
SYS_STUYPW88OE302TFVBNC6$MMQXE SYS_OP_COMBINED_HASH("X","Y") YES
Z NO
Y NO
X NO
exec dbms_stats.drop_extended_stats(user, 'tab', '(x, y)');
alter table tab modify (y timestamp);
select dbms_stats.create_extended_stats(user, 'tab', '(x, y)')
from dual;
DBMS_STATS.CREATE_EXTENDED_STATS(USER,'TAB','(X,Y)')
--------------------------------------------------------------------------------
SYS_STUYPW88OE302TFVBNC6$MMQXE
These actions will help prevent future developers getting stuck tracking down the cause of "missing" virtual columns!
]]><input class="easyui-combobox" id="rwlb" name="rwlb" style="width:435px" data-options="valueField:'id', textField:'text', panelHeight:'auto'" >
1 var data, json;
2 json = '[{"id":"騫磋鍒?,"text":"騫磋鍒?,"selected":true}]';
3 data = $.parseJSON(json);
4 $("#rwlb").combobox("loadData", data);
1 var data,json;
2 data = [];
3 data.push({ "text": "嫻嬭瘯", "id": 100 });
4 $("#rwlb").combobox("loadData", data);
]]>
1
$.extend($.fn.tree.methods, {
2
getLevel:
function
(jq,target){
3
var
l = $(target).parentsUntil(
"ul.tree"
,
"ul"
);
4
return
l.length+1;
5
}
6
});
1
var
node = $().tree(
"getSelected"
);
2
var
lv = $().tree(
"getLevel"
,node.target);
]]>
select to_char(100,'XX') from dual;
鍏朵腑XX涓烘牸寮忥紝娉ㄦ剰XX鐨勪綅鏁頒笉鑳藉皬浜?/span>浼犲叆鐨勫弬鏁般?br />
]]>
void foo(int a, int b = 1, bool c = false);
鍦?a style="color: rgb(51,51,51); font-size: 14px; text-decoration: none" class="keylink" target="_blank">Java涓紝鍒欏彲浠ラ氳繃鍑芥暟閲嶈澆鏉ヨ緗嚱鏁板弬鏁伴粯璁ゅ鹼細(xì)
public void foo(int a){
foo(a, 1);
}
public void foo(int a, int b){
foo(a, b, false);
}
public void foo(int a, int b, bool c){
//鍑芥暟鍐呭
}
鑰屽湪JavaScript涓紝濡備綍鍍廽Query閭f牱璁劇疆鍑芥暟鍙傛暟榛樿鍊煎憿錛烰avaScript涓茍娌℃湁鍍廋璇█涓畾涔夊嚱鏁版椂鐩存帴鍦ㄥ弬鏁板悗闈㈣祴鍊肩殑鏂規(guī)硶錛屼篃娌℃湁鍍廕ava閲岄偅鏍風(fēng)殑鍑芥暟閲嶈澆錛屼絾鎴戜滑鍙互閫氳繃JavaScript鏂規(guī)硶涓殑涓涓猘rguments鍙鍙橀噺鏁扮粍鏉ュ疄鐜幫紝鍏蜂綋濡備笅錛?/p>
function foo(){
var a = arguments[0] ? arguments[0] : 1;
var b = arguments[1] ? arguments[1] : false;
//鍑芥暟鍐呭
}
浠ヤ笂鏄氳繃鍒ゆ柇鍙傛暟鏄惁瀛樺湪錛岃嫢涓嶅瓨鍦ㄥ垯灝嗛粯璁ゅ奸檮緇欏彉閲忥紝鑰屾垜浠彲浠ラ氳繃鍒ゆ柇鍙傛暟鐨勭被鍨嬫潵瀹炵幇閲嶈澆錛?/p>
function foo(){
if(typeof arguments[0] == 'string')
alert('鍙傛暟綾誨瀷涓哄瓧絎︿覆');
else if(typeof arguments[0] == 'number')
alert('鍙傛暟綾誨瀷涓烘暟鍊?);
}
鎴栬咃細(xì)
function foo(){
if(arguments[0].constructor == String)
alert('鍙傛暟綾誨瀷涓哄瓧絎︿覆');
else if(arguments[0].constructor == Number)
alert('鍙傛暟綾誨瀷涓烘暟鍊?);
}
]]>
insert Tree values('鎴?,'緗戠粶1鐝?)
{
foreach (DataRow dr in dt.Rows)
{
if (dr.RowState == DataRowState.Deleted)
continue;
if (dr.RowState == DataRowState.Modified || dr.RowState == DataRowState.Added)
{
if (dr["usr_id"] == DBNull.Value)
{
throw new Exception("鐢ㄦ埛浠g爜涓嶈兘涓虹┖");
} }
}
}
{
SqlDataAdapter adapter = new SqlDataAdapter();
SqlConnection conn = new SqlConnection(SqlHelper.ConnectionString);
conn.Open();
adapter.InsertCommand.CommandType = CommandType.Text;
adapter.InsertCommand.Parameters.Add("@com_id", SqlDbType.VarChar, 4, "com_id");
adapter.InsertCommand.Parameters.Add("@usr_id", SqlDbType.VarChar, 8, "usr_id");
adapter.UpdateCommand.CommandType = CommandType.Text;
adapter.UpdateCommand.Parameters.Add("@com_id", SqlDbType.VarChar, 4, "com_id");
adapter.UpdateCommand.Parameters.Add("@usr_id", SqlDbType.VarChar, 8, "usr_id");
adapter.UpdateCommand.Parameters.Add("@usr_id1", SqlDbType.VarChar, 8, "usr_id");
adapter.UpdateCommand.Parameters["@usr_id1"].SourceVersion = DataRowVersion.Original;
adapter.DeleteCommand.CommandType = CommandType.Text;
adapter.DeleteCommand.Parameters.Add("@com_id", SqlDbType.VarChar, 4, "com_id");
adapter.DeleteCommand.Parameters.Add("@usr_id", SqlDbType.VarChar, 8, "usr_id");
adapter.DeleteCommand.Parameters["@usr_id"].SourceVersion = DataRowVersion.Original;
}
{
public DataTable dtUsr = new DataTable();
public MOD.Users modObject = new MOD.Users();
{
InitializeComponent();
dataGridView1.AutoGenerateColumns = false;
}
{
dtUsr = Bu.GetList();
dataGridView1.DataSource = dtUsr;
BindValue();
}
{
tb_com_id.DataBindings.Add("Text", dataGridView1.DataSource, "com_id");
tb_UsrId.DataBindings.Add("Text", dataGridView1.DataSource, "usr_id");
}
{
foreach (DataRow dr in dtUsr.Rows)
{
dr.EndEdit();
}
try
{
Bu.Update(dtUsr);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
MessageBox.Show("淇濆瓨鎴愬姛錛?, "緋葷粺鎻愮ず");
}
{
if (MessageBox.Show("鎮(zhèn)ㄧ‘璁よ鍒犻櫎鐢ㄦ埛錛? + tb_UsrName.Text.Trim()+" ?", "鎻愮ず", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
return;
return;
{
dataGridView1.Rows.Remove(dataGridView1.CurrentRow);
Bu.Update(dtUsr);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
MessageBox.Show("鍒犻櫎鎴愬姛錛?, "緋葷粺鎻愮ず");
}
{
DataRow dr = dtUsr.NewRow();
dr["usr_id"] = _UserId;
dtUsr.Rows.Add(dr);
dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];
}
{
dtUsr.RejectChanges();
}
鐗涢搧錛?a style="color: rgb(63,167,203); text-decoration: underline" >http://blog.csdn.net/fangxinggood/archive/2008/04/18/2304047.aspx
]]>
鍦?span class="Apple-converted-space"> DataSet 涓垱寤?span class="Apple-converted-space"> DataTable 涔嬪悗錛屾?zhèn)ㄦ墽琛岀殑娲诲姩鍙互涓庝娇鐢ㄦ暟鎹簱涓殑琛ㄦ椂鎵ц鐨剫z誨姩鐩稿悓銆傛?zhèn)ㄥ彲浠ユ氛d姞銆佹煡鐪嬨佺紪杈戝拰鍒犻櫎琛ㄤ腑鐨勬暟鎹紱鍙互鐩戣閿欒鍜屼簨浠訛紱騫朵笖鍙互鏌ヨ琛ㄤ腑鐨勬暟鎹傚湪淇敼 DataTable 涓殑鏁版嵁鏃訛紝鎮(zhèn)ㄤ篃鍙互楠岃瘉鏇存敼鏄惁姝g‘錛屽茍鍐沖畾鏄惁浠ョ紪紼嬫柟寮忔帴鍙楁洿鏀規(guī)垨鎷掔粷鏇存敼銆?/p>
鍦ㄥ垱寤?span class="Apple-converted-space"> DataTable 騫朵嬌鐢ㄥ垪鍜岀害鏉熷畾涔夊叾緇撴瀯涔嬪悗錛屾?zhèn)ㄥ彲浠畣鏂扮殑鏁版嵁琛屾坊鑷宠〃涓傝娣誨姞鏂拌錛屽彲灝嗕竴涓柊鍙橀噺澹版槑涓?span class="Apple-converted-space"> DataRow 綾誨瀷銆傝皟鐢?span class="Apple-converted-space"> NewRow 鏂規(guī)硶鏃訛紝灝嗚繑鍥炴柊鐨?span class="Apple-converted-space"> DataRow 瀵硅薄銆傜劧鍚庯紝DataTable 浼?xì)鏍规嵁琛ㄧ殑缁撴瀯鎸?span id="jfr3vdz" class="Apple-converted-space"> DataColumnCollection 鐨勫畾涔夊垱寤?span class="Apple-converted-space"> DataRow 瀵硅薄銆?
workRow[1] = "Smith";
for (int i = 0; i <= 9; i++)
{
workRow = workTable.NewRow();
workRow[0] = i;
workRow[1] = "CustName" + i.ToString();
workTable.Rows.Add(workRow);
}
鍙互浣跨敤 DataTable 鐨?span class="Apple-converted-space"> Rows 鍜?span class="Apple-converted-space"> Columns 闆嗗悎鏉ヨ闂?span class="Apple-converted-space"> DataTable 涓殑鍐呭銆備篃鍙互鏍規(guī)嵁鍖呮嫭鎼滅儲(chǔ)鏍囧噯銆佹帓搴忛『搴忓拰琛岀姸鎬佺瓑鐗瑰畾鏍囧噯錛屼嬌鐢?span class="Apple-converted-space"> DataTable.Select 鏂規(guī)硶榪斿洖 DataTable 涓暟鎹殑瀛愰泦銆傛澶栵紝鐢ㄤ富閿兼悳绱㈢壒瀹氳鏃訛紝榪樺彲浣跨敤 DataRowCollection 鐨?span class="Apple-converted-space"> LastName = 'Smith'
銆傛帓搴忚〃杈懼紡閬靛驚鐢ㄤ簬涓哄垪鎺掑簭鐨勬爣鍑?SQL 綰﹀畾錛屼緥濡?span class="Apple-converted-space"> LastName ASC, FirstName ASC
銆傛湁鍏崇紪鍐欒〃杈懼紡鐨勮鍒欙紝璇峰弬闃?strong>DataColumn 綾葷殑 鎻愮ず 濡傛灉鎮(zhèn)ㄥ皢瀵?span class="Apple-converted-space"> DataTable 鐨?span class="Apple-converted-space"> Select 鏂規(guī)硶鎵ц澶氭璋冪敤錛屽彲閫氳繃鍏堜負(fù) DataTable 鍒涘緩 DataView鏉ユ彁楂樻ц兘銆傚垱寤?span class="Apple-converted-space"> DataView 浼?xì)湄?fù)琛ㄤ腑鐨勮緙栧埗绱㈠紩銆傜劧鍚庯紝Select 鏂規(guī)硶浼?xì)鋴社敤璇ョ储寮曞Q岃繖鏍峰皢鏄捐憲緙╃煭鐢熸垚鏌ヨ緇撴灉鐨勬椂闂淬傛湁鍏充負(fù) DataTable 鍒涘緩 DataView 鐨勪俊鎭紝璇峰弬闃?a style="color: rgb(51,102,153); text-decoration: none" >鍒涘緩鍜屼嬌鐢?DataView銆?/blockquote>
鎴愬憳鍚嶇О
璇存槑
CurrentRows
褰撳墠琛岋紝鍖呮嫭鏈洿鏀圭殑琛屻佸凡娣誨姞鐨勮鍜屽凡淇敼鐨勮銆?/td>
Deleted
宸插垹闄ょ殑琛屻?/td>
ModifiedCurrent
褰撳墠鐗堟湰錛屽畠鏄師濮嬫暟鎹殑淇敼鐗堟湰錛堣鍙傞槄ModifiedOriginal錛夈?/td>
ModifiedOriginal
鎵鏈夊凡淇敼琛岀殑鍘熷鐗堟湰銆備嬌鐢?span class="Apple-converted-space"> ModifiedCurrent 鏃訛紝褰撳墠鐗堟湰鍙敤銆?/td>
Added
鏂拌銆?/td>
None
鏃犮?/td>
OriginalRows
鍘熷琛岋紝鍖呮嫭鏈洿鏀圭殑琛屽拰宸插垹闄ょ殑琛屻?/td>
Unchanged
鏈洿鏀圭殑琛屻?/td>
if (currRows.Length < 1 )
Console.WriteLine("No Current Rows Found");
else
{
foreach (DataColumn myCol in workTable.Columns)
Console.Write("/t{0}", myCol.ColumnName);
Console.WriteLine("/tRowState");
foreach (DataRow myRow in currRows)
{
foreach (DataColumn myCol in workTable.Columns)
Console.Write("/t{0}", myRow[myCol]);
Console.WriteLine("/t" + myRow.RowState);
}
}
DataRow[] delRows = workTable.Select(null, null, DataViewRowState.Deleted);
// Retrieve rows where CustID > 5, and order by CustLName.
DataRow[] custRows = workTable.Select("CustID > 5", "CustLName ASC");
褰撴?zhèn)ㄥ?span class="Apple-converted-space"> DataRow 涓洿鏀瑰垪鍊兼椂錛屾墍鍋氭洿鏀逛細(xì)绔嬪嵆緗簬琛岀殑 Current 鐘舵佷腑銆傜劧鍚庯紝RowState 浼?xì)璁揪|負(fù)Modified錛屽茍浣跨敤 DataRow 鐨?span class="Apple-converted-space"> AcceptChanges 鎴?span class="Apple-converted-space"> RejectChanges 鏂規(guī)硶鏉ユ帴鍙楁垨鎷掔粷鎵鍋氭洿鏀廣?strong>DataRow榪樻彁渚涗簡涓夌鍙敤浜庡湪緙栬緫琛屾椂灝嗚鐨勭姸鎬佹寕璧風(fēng)殑鏂規(guī)硶銆傝繖浜涙柟娉曟槸 BeginEdit銆?strong>EndEdit 鍜?span class="Apple-converted-space"> CancelEdit銆?
workTable.Columns.Add("LastName", typeof(String));
workTable.ColumnChanged += new DataColumnChangeEventHandler(OnColumnChanged);
DataRow workRow = workTable.NewRow();
workRow[0] = "Smith";
workTable.Rows.Add(workRow);
workRow.BeginEdit();
// Causes the ColumnChanged event to write a message and cancel the edit.
workRow[0] = "";
workRow.EndEdit();
// Displays "Smith, New".
Console.WriteLine("{0}, {1}", workRow[0], workRow.RowState);
protected static void OnColumnChanged(Object sender, DataColumnChangeEventArgs args)
{
if (args.Column.ColumnName == "LastName")
if (args.ProposedValue.ToString() == "")
{
Console.WriteLine("Last Name cannot be blank. Edit canceled.");
args.Row.CancelEdit();
}
}
ADO.NET 鐢ㄨ鐘舵佸拰鐗堟湰綆$悊琛ㄤ腑鐨勮銆傝鐘舵佽〃紺鴻鐨勭姸鎬併傚綋淇敼琛屾椂錛岃鐗堟湰浼?xì)缁存姢瀛樺偍浜庤涓殑鍊鹼紝鍖呮嫭褰撳墠鍊箋佸師濮嬪煎拰榛樿鍊箋備緥濡傦紝淇敼浜嗘煇琛屼腑鐨勪竴鍒楀悗錛岃琛屼細(xì)鏈変竴涓?span class="Apple-converted-space"> Modified 鐨勮鐘舵侊紝騫朵笖浼?xì)瀛樺湪涓や釜琛岀増鏈Q?strong>Current錛堝寘鍚綋鍓嶈鍊鹼級(jí)鍜?span class="Apple-converted-space"> Original錛堝寘鍚慨鏀硅鍒楀墠鐨勮鍊鹼級(jí)銆?
RowState
璇存槑
Unchanged
鑷笂嬈¤皟鐢?span class="Apple-converted-space"> AcceptChanges 涔嬪悗錛屾垨鑷?span class="Apple-converted-space"> DataAdapter.Fill 鍒涘緩浜嗚涔嬪悗錛屾湭鍋氬嚭榪囦換浣曟洿鏀廣?/td>
Added
宸插皢琛屾坊鑷寵〃涓紝浣嗗皻鏈皟鐢?span class="Apple-converted-space"> AcceptChanges銆?/td>
Modified
宸叉洿鏀逛簡琛岀殑涓浜涘厓绱犮?/td>
Deleted
宸插皢璇ヨ浠庤〃涓垹闄わ紝騫朵笖灝氭湭璋冪敤 AcceptChanges銆?/td>
Detached
瀵逛簬宸茬粡鍒涘緩浣嗕笉灞炰簬浠諱綍 DataRowCollection 鐨勮錛岃緗負(fù) Detached銆傛柊寤鴻鐨?span class="Apple-converted-space"> RowState璁劇疆涓?span class="Apple-converted-space"> Detached銆傞氳繃璋冪敤 Add 鏂規(guī)硶灝嗘柊鐨?span class="Apple-converted-space"> DataRow 娣昏嚦 DataRowCollection 涔嬪悗錛?strong>RowState 灞炴х殑鍊艱緗負(fù) Added銆?
string custID = custRow["CustomerID", DataRowVersion.Original].ToString();
DataRowVersion
璇存槑
Current
琛岀殑褰撳墠鍊箋傚鏋滄槸鏈?span class="Apple-converted-space"> Deleted 鐨?span class="Apple-converted-space"> RowState 鐨勮錛屽垯涓嶅瓨鍦ㄦ琛岀増鏈?/td>
Default
鐗瑰畾琛岀殑榛樿琛岀増鏈?strong>Added銆?strong>Modified 鎴?span class="Apple-converted-space"> Unchanged 琛岀殑榛樿琛岀増鏈槸Current銆?strong>Deleted 琛岀殑榛樿琛岀増鏈槸 Original銆?strong>Detached 琛岀殑榛樿琛岀増鏈槸 Proposed銆?/td>
Original
琛岀殑鍘熷鍊箋傚鏋滄槸鏈?span class="Apple-converted-space"> Added 鐨?span class="Apple-converted-space"> RowState 鐨勮錛屽垯涓嶅瓨鍦ㄦ琛岀増鏈?/td>
Proposed
琛岀殑寤鴻鍊箋傚湪瀵硅榪涜緙栬緫鎿嶄綔鏈熼棿錛屾垨瀵逛簬涓嶅睘浜?span class="Apple-converted-space"> DataRowCollection 鐨勮錛屽瓨鍦ㄦ琛岀増鏈?/td>
DataRow[] delRows = catTable.Select(null, null, DataViewRowState.Deleted);
Console.WriteLine("Deleted rows:/n");
foreach (DataColumn catCol in catTable.Columns)
Console.Write(catCol.ColumnName + "/t");
Console.WriteLine();
foreach (DataRow delRow in delRows)
{
foreach (DataColumn catCol in catTable.Columns)
Console.Write(delRow[catCol, DataRowVersion.Original] + "/t");
Console.WriteLine();
}
鐢ㄤ簬浠?span class="Apple-converted-space"> DataTable 瀵硅薄涓垹闄?span class="Apple-converted-space"> DataRow 瀵硅薄鐨勬柟娉曟湁涓ょ錛?strong>DataRowCollection 瀵硅薄鐨?span class="Apple-converted-space"> Remove 鏂規(guī)硶鍜?strong>DataRow 瀵硅薄鐨?span class="Apple-converted-space"> Delete 鏂規(guī)硶銆?strong>Remove 鏂規(guī)硶浠?span class="Apple-converted-space"> DataRowCollection 涓垹闄?span class="Apple-converted-space"> DataRow錛岃?span class="Apple-converted-space"> Delete 鏂規(guī)硶鍙皢琛屾爣璁頒負(fù)鍒犻櫎銆傚綋搴旂敤紼嬪簭璋冪敤 AcceptChanges 鏂規(guī)硶鏃訛紝鎵嶄細(xì)鍙戠敓瀹為檯鐨勫垹闄ゃ傞氳繃浣跨敤 Delete錛屾?zhèn)ㄥ彲浠ュ湪瀹為檯鍒犻櫎涔嬪墠鍏堜互缂柦E嬫柟寮忔鏌ュ摢浜涜鏍囪涓哄垹闄ゃ傚鏋滃皢琛屾爣璁頒負(fù)鍒犻櫎錛屽叾 RowState 灞炴т細(xì)璁劇疆涓?span class="Apple-converted-space"> Deleted銆?
娉ㄦ剰 濡傛灉 DataRow 鐨?span class="Apple-converted-space"> RowState 鏄?span class="Apple-converted-space"> Added錛屽垯鎰忓懗鐫宸插皢鍏舵坊鑷寵〃涓紝鐒跺悗灝嗗叾鏍囪涓?strong>Deleted錛屼粠琛ㄤ腑縐婚櫎銆?/blockquote>
涓轟簡閬垮厤鍦ㄧ紪杈?span class="Apple-converted-space"> DataTable 涓殑鍊兼椂姣忔鍙戠敓琛岄敊璇兘蹇呴』鍝嶅簲錛屽彲灝嗛敊璇俊鎭坊鑷寵涓紝浠ヤ究浠ュ悗浣跨敤銆?strong>DataRow 瀵硅薄閫氳繃瀵瑰悇琛屾彁渚?span class="Apple-converted-space"> RowError 灞炴ф潵鏀寔姝ゅ姛鑳姐傚皢鏁版嵁娣昏嚦 DataRow 鐨?span class="Apple-converted-space"> RowError 灞炴т細(xì)灝?strong>DataRow 鐨?span class="Apple-converted-space"> HasErrors 灞炴ф爣璁頒負(fù) true銆傚鏋?span class="Apple-converted-space"> DataRow 鏄?span class="Apple-converted-space"> DataTable 鐨勭粍鎴愰儴鍒嗭紝涓?span class="Apple-converted-space"> DataRow.HasErrors鏄?span class="Apple-converted-space"> true錛屽垯 DataTable.HasErrors 灞炴т篃鏄?span class="Apple-converted-space"> true銆傝繖涔熼傜敤浜?span class="Apple-converted-space"> DataTable 鎵灞炵殑 DataSet銆備負(fù)閿欒鍋氭祴璇曟椂錛屽彲浠ユ鏌?span class="Apple-converted-space"> HasErrors 灞炴т互紜畾閿欒淇℃伅鏄惁宸叉坊鑷蟲墍鏈夎銆傚鏋?span class="Apple-converted-space"> HasErrors 涓?span class="Apple-converted-space"> true錛屽垯鍙嬌鐢?span class="Apple-converted-space"> DataTable 鐨?strong>GetErrors 鏂規(guī)硶浠ヤ究鍙繑鍥炲拰媯(gè)鏌ユ湁閿欒鐨勮錛屽涓嬩緥鎵紺恒?
workTable.Columns.Add("CustID", typeof(Int32));
workTable.Columns.Add("Total", typeof(Double));
workTable.RowChanged += new DataRowChangeEventHandler(OnRowChanged);
for (int i = 0; i < 10; i++)
workTable.Rows.Add(new Object[] {i, i*100});
if (workTable.HasErrors)
{
Console.WriteLine("Errors In Table " + workTable.TableName);
foreach (DataRow myRow in workTable.GetErrors())
{
Console.WriteLine("CustID = " + myRow["CustID"]);
Console.WriteLine(" Error = " + myRow.RowError + "/n");
}
}
protected static void OnRowChanged(Object sender, DataRowChangeEventArgs args)
{
// Check for zero values.
if (args.Row["Total"].Equals(0D))
args.Row.RowError = "Total cannot be 0.";
}
鍦ㄦ楠岃繃瀵?span class="Apple-converted-space"> DataTable 涓殑鏁版嵁鎵鍋氭洿鏀圭殑鍑嗙‘鎬т箣鍚庯紝鍙嬌鐢?span class="Apple-converted-space"> DataRow銆?strong>DataTable 鎴?span class="Apple-converted-space"> DataSet 鐨?strong>AcceptChanges 鏂規(guī)硶鏉ユ帴鍙楁洿鏀癸紝姝ゆ柟娉曚細(xì)灝?span class="Apple-converted-space"> Current 琛屽艱緗負(fù) Original 鍊鹼紝騫朵細(xì)灝?span class="Apple-converted-space"> RowState 灞炴ц緗負(fù) Unchanged銆傛帴鍙楁垨鎷掔粷鏇存敼浼?xì)娓呴櫎鎵鏈?span class="Apple-converted-space"> RowError 淇℃伅錛屽茍灝?span class="Apple-converted-space"> HasErrors 灞炴ц緗負(fù) false銆傛帴鍙楁垨鎷掔粷鏇存敼榪樺彲浠ュ獎(jiǎng)鍝嶅湪鏁版嵁婧愪腑鏇存柊鏁版嵁銆傛湁鍏蟲洿澶氫俊鎭紝璇峰弬闃?a style="color: rgb(51,102,153); text-decoration: none" >浣跨敤 DataAdapter 鍜?DataSet 鏇存柊鏁版嵁搴?/a>銆?
{
foreach (DataRow errRow in workTable.GetErrors())
{
if (errRow.RowError == "Total cannot exceed 1000.")
{
errRow["Total"] = 1000;
errRow.RowError = ""; // Clear the error.
}
else
errRow.RejectChanges();
}
}
workTable.AcceptChanges();
DataTable 瀵硅薄鎻愪緵涓緋誨垪鍙敱搴旂敤紼嬪簭澶勭悊鐨勪簨浠躲備笅琛ㄨ鏄庝簡 DataTable 浜嬩歡銆?
浜嬩歡
璇存槑
ColumnChanged
鍦ㄥ煎凡鎴愬姛鎻掑叆鍒楁椂鍙戠敓銆?/td>
ColumnChanging
鍦ㄥ凡鎻愪氦鍒楀兼椂鍙戠敓銆?/td>
RowChanged
鍦ㄥ凡鎴愬姛緙栬緫琛ㄤ腑鐨勮鍚庡彂鐢熴?/td>
RowChanging
褰撴鍦ㄦ洿鏀硅〃涓殑琛屾椂鍙戠敓銆?/td>
RowDeleted
鍦ㄨ〃涓殑鏌愯宸茶鏍囪涓?span class="Apple-converted-space"> Deleted 涔嬪悗鍙戠敓銆?/td>
RowDeleting
鍦ㄨ〃涓殑鏌愯琚爣璁頒負(fù) Deleted 涔嬪墠鍙戠敓銆?/td>
workTable.ColumnChanging += new DataColumnChangeEventHandler(OnColumnChanging);
workTable.RowChanged += new DataRowChangeEventHandler(OnRowChanged);
workTable.RowChanging += new DataRowChangeEventHandler(OnRowChanging);
protected static void OnColumnChanged(object sender, DataColumnChangeEventArgs args)
{
Console.Write(" ColumnChanged: ");
Console.Write(args.Column.ColumnName + " changed to '" + args.ProposedValue + "'/n");
}
protected static void OnColumnChanging(object sender, DataColumnChangeEventArgs args)
{
Console.Write("ColumnChanging: ");
Console.Write(args.Column.ColumnName + " equals '" + args.Row[args.Column] +
"', changing to '" + args.ProposedValue + "'/n");
}
protected static void OnRowChanging(object sender, DataRowChangeEventArgs args)
{
if (args.Action != DataRowAction.Nothing)
Console.WriteLine(" RowChanging: Action = " + args.Action + ", CustID = " + args.Row["CustID"]);
}
protected static void OnRowChanged(object sender, DataRowChangeEventArgs args)
{
if (args.Action != DataRowAction.Nothing)
Console.WriteLine(" RowChanged: Action = " + args.Action + ", CustID = " + args.Row["CustID"]);
}
]]>
]]>
]]>
]]>
The new table must include the AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated and UpdatedBy fields that are mandatory and required for security and auditory purposes of the application.
Each table must have at least one column marked as an identifier. The actual values of identifier columns later get concatenated to be shown to the user as a representation of a particular record (see the link to the Sales Order within the Sales Invoice window). These identifiers will also be used to construct dropdown lists of records of that particular table. By default all columns with column name Name are set as an identifier. In case there is no column with this Name, no identifier is set and needs to be done so manually or compilation will fail.
NOTE: The columns that are named line or seqNo are used to contain the sequence number of a record (i.e. the number of a line in an invoice). They take a default value like: How to add Columns to a Table
These changes can be done in two different locations:
How to add a Constraint
Creating a new instance of a Business Object
A business object may never be created using the Java new operator. All business objects should be created using the OBProvider factory class:
// create the object through the factory final Category bpg = OBProvider.getInstance().get(Category.class);
Hibernate will detect that a business object is new when:
So if you want to create a new business object with a specific id (by calling setId(...)) then you explicitly need to call businessObject.setNewOBObject(true). Otherwise, Hibernate will throw an exception ('count of batch update operation....').
涓鏄痩inux鏈嶅姟鍣ㄧ鐨則ftp-server鏀寔,
浜屾槸宓屽叆寮忕洰鏍囩郴緇熺殑tftp-client鏀寔.
鍥犱負(fù)u-boot鏈韓鍐呯疆鏀寔tftp-client,鎵浠ュ祵鍏ュ紡鐩爣緋葷粺绔氨涓嶇敤閰嶇疆浜?
涓嬮潰灝辮緇嗕粙緇嶄竴涓媗inux鏈嶅姟鍣ㄧtftp server閰嶇疆.鍦╮edhat 9.0鐨勭涓夊紶鍏夌洏涓?鏈塼ftp-server鐨勫畨瑁卹pm鍖?錛?錛?nbsp; 瀹夎
#mount –t iso9660 /dev/hdc /mnt/cdrom //鎸傝澆鍏夌洏
#rpm -ivh tftp-server-0.32-4.i386.rpm //瀹夎
#umount /mnt/cdrom //鍗歌澆鍏夌洏
錛?錛変慨鏀規(guī)枃浠跺湪linux涓?涓嶇浣跨敤鐨勬槸鍝竴縐峴uper-server,inetd鎴栬厁inetd,榛樿鎯呭喌涓婽FTP鏈嶅姟鏄鐢ㄧ殑,鎵浠ヨ淇敼鏂囦歡鏉ュ紑鍚湇鍔?
鏍規(guī)嵁錛?錛夌殑瀹夎鏂規(guī)硶,鍙互淇敼鏂囦歡/etc/xinetd.d/tftp.涓昏鏄緗甌FTP鏈嶅姟鍣ㄧ殑鏍圭洰褰?寮鍚湇鍔?
淇敼鍚庣殑鏂囦歡濡備笅:
service tftp {
socket_type =dgram
protocol =udp
wait =yes
user =root
server =/usr/sbin/in.tftpd
server_args =-s /home/app -c
disable =no
per_source =11
cps =100 2
flags =IPv4
}
璇存槑:淇敼欏箂erver_args= -s <path> -c,鍏朵腑<path>澶勫彲浠ユ敼涓轟綘鐨則ftp server閰嶇疆鐨勬牴鐩綍,鍙傛暟-s鎸囧畾chroot,-c鎸囧畾浜嗗彲浠ュ垱寤烘枃浠?
錛?錛夊垱寤簍ftp鏍圭洰褰?鍏抽棴闃茬伀澧?鍚姩tftp-server.
#mkdir /home/app
#chmod o+w /home/app
#/etc/init.d/iptables stop //鍏抽棴闃茬伀澧?/p>
#service xinetd restart //閲嶅惎 xinetd 鏈嶅姟
閲嶅惎xinetd鏈嶅姟,鍥犱負(fù)TFTP鏈嶅姟鍙楁帶涓巟inetd, xinetd鏄鏈嶅姟鐨勬湇鍔?瀹冩槸涓嶅紑绔彛鐨?
楠岃瘉涓涓婽FTP鏄惁璧鋒潵浜?
# netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN 3122/rpc.statd
tcp 0 0 127.0.0.1:32781 0.0.0.0:* LISTEN 4035/xinetd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3103/portmap
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3324/httpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3255/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3213/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3295/sendmail: acce
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 3415/0
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3324/httpd
udp 0 0 0.0.0.0:32768 0.0.0.0:* 3122/rpc.statd
udp 0 0 0.0.0.0:69 0.0.0.0:* 4035/xinetd ;
鍙互鐪嬪埌69绔彛宸茬粡鎵撳紑
udp 0 0 0.0.0.0:69 0.0.0.0:* 4012/in.tftpd
udp 0 0 0.0.0.0:111 0.0.0.0:* 3103/portmap
udp 0 0 0.0.0.0:754 0.0.0.0:* 3122/rpc.statd
udp 0 0 0.0.0.0:631 0.0.0.0:* 3213/cupsd
榪欐牱,tftp server閰嶇疆鐨勫惎鍔ㄦ楠ゅ氨瀹屾垚浜嗐?/p>
浣犲彲浠ョ櫥闄嗘湰鏈烘祴璇曚互涓?鍛戒護(hù)濡備笅:
#tftp your-ip-address
tftp>get <download file>
tftp>put <upload file>
tftp>q
鍘熷洜 錛氬伐紼嬪彧鏀寔UNICODE瀛楃
瑙e喅鏂規(guī)硶錛?/p>
宸ョ▼灞炴?>閰嶇疆灞炴?#8211;>甯歌—>瀛楃闆?#8212;->浣跨敤澶氬瓧鑺傜瀛楃闆?/strong>
鍥?銆佸嚑鐐硅璁頒綇錛?/p>
銆銆1 浣跨敤#using寮曠敤C# DLL錛岃屼笉鏄?include.鎴戝氨鏄兂褰撶劧鐨勪嬌鐢ㄤ簡鍚庤咃紝鎵浠ユ氮璐逛簡涓涓婂崍鐨勬椂闂達(dá)紱
銆銆2 鍒繕浜唘sing namespace CSLib錛?/p>
銆銆3 浣跨敤C++/clr璇硶錛岄噰鐢ㄦ紜殑璁塊棶鎵樼瀵硅薄錛屽嵆錛氫嬌鐢ㄥ附瀛?#8216;^’錛岃屼笉鏄槦鏄?#8216;*’銆?br />
PS錛氶檮涓婅嚜宸辨垚鍔熻繍琛孋++浠g爜
#include "stdafx.h"
#include <iostream>
//#using "..\..\SFCSDLL.dll" //鍙沖嚮欏圭洰-->寮曠敤...錛屾坊鍔犳柊寮曠敤錛屽皢DLL娣誨姞鍒伴」鐩腑錛屽彲浠ヤ笉鐢ㄦ琛屼唬鐮?/p>
using namespace std;
using namespace SFCSDLL;
int _tmain(int argc, _TCHAR* argv[])
{
Class1 ^c = gcnew Class1();
c->SFCSDLL_Create_Connection("127.0.0.1", 0, 0, 0, 0);
c->SFCSDLL_Get_DLLVersion();
c->SFCSDLL_Close_Connection();
cout<<"end...";
system("pause");
return 0;
}
緗戜笂鏈甯歌鐨勫仛娉曟槸鐢?/span>DataGridView鐨?/span>RowPostPaint浜嬩歡鍦?/span>RowHeaderCell涓粯鍒惰鍙鳳細(xì)
privatevoiddataGridView1_RowPostPaint(objectsender, DataGridViewRowPostPaintEventArgs e)
{
try
{
e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, new SolidBrush(Color.CadetBlue), e.RowBounds.Location.X + 15, e.RowBounds.Location.Y + 5);
}
catch(Exception ex)
{
MessageBox.Show("娣誨姞琛屽彿鏃跺彂鐢熼敊璇紝閿欒淇℃伅錛?/span>"+ex.Message, "鎿嶄綔澶辮觸");
}
}
浣嗘槸榪欑鏂規(guī)硶鍦ㄥぇ鏁版嵁閲忕殑鏃跺欐ц兘姣旇緝宸紝姣忔婊氬姩鏁版嵁閮戒細(xì)瑙﹀彂RowPostPaint浜嬩歡銆?/span>
鍦╒S2008閲岋紝涔熷彲浠ュ儚Eclipse閭f牱鑷姩鐢熸垚get 銆乻et鏂規(guī)硶銆?br />
涓嬮潰鏄袱涓叿浣撴搷浣滅殑鏂規(guī)硶錛?br />
1銆佸湪緙栧啓鐨勫瓧孌典笂鍗曞嚮鍙抽敭----->閲嶆瀯------->灝佽瀛楁
2銆佸湪絀虹櫧琛屽錛岃緭鍏?#8220;prop”鍐嶆寜Tab閿?/p>
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)