Private Sub DataGrid1_Click()
End Sub
Private Sub Form_Load()
Dim i As Integer
'裝入一級類目
Combospecialty.AddItem "全部"
MyClass.Load_by_Upper (0)
i = 0
Do While Arr_ClassName(i) <> ""
Combospecialty.AddItem Arr_ClassName(i)
i = i + 1
Loop
Combospecialty.ListIndex = 0
'不顯示二級類目
Comboclass.Visible = False
Combofour.ListIndex = 0
End Sub
Private Sub Refresh_culture()
Dim TmpSource As String
TmpSource = "SELECT S.Student_Id as 學生序號,S.Student_Name as 姓名,S.BadgeID as 學號, " _
+ " C1.Class_Name as 專業名稱,C2.class_name as 班級名稱,convert(char,F.Student_Grade) as 學年,F.yearinput as 年度," _
+ "F.Cet_Four as 四級成績, F.Cet_Six as 六級成績, F.NationPC_Two as 全國計算機二級成績, " _
+ "F.NationPC_Three as 全國計算機三級成績, F.NationPC_Four as 全國計算機四級成績, F.JsPC_Two as 江蘇計算機二級成績," _
+ "F.JsPC_Three as 江蘇計算機三級成績,F.Basicjudge_Type as 基本素質測評型別,F.Basicjudge_Score as 基本素質測評分,F.grow_score as 發展素質分," _
+ "F.Culture_Memo as 文化備注 " _
+ "FROM Students S,Classes C1,classes C2 ,Student_four F" _
+ " WHERE S.Class_Id = C2.Class_Id And S.student_ID=f.student_ID and C2.UpperId =C1.class_ID And S.Student_Id = F.Student_Id "
If Combospecialty.ListIndex <> 0 Then
If Comboclass.ListIndex = 0 Then
TmpSource = TmpSource + " and C1.class_name='" + Trim(Combospecialty.Text) + "'"
Else
TmpSource = TmpSource + " and C1.class_name='" + Trim(Combospecialty.Text) _
+ "' and C2.class_name='" + Trim(Comboclass.Text) + "'"
End If
End If
TmpSource = TmpSource + " and cast(F.Student_Grade as char)='" + Trim(Combofour.Text) + "'"
TmpSource = TmpSource + " order by s.student_ID asc"
Adodc1.RecordSource = TmpSource
Adodc1.Refresh
DataGrid1.Refresh
If Adodc1.Recordset.EOF = True Then
'MsgBox "沒有資料可供匯出!"
Command1.Enabled = False
Else
Command1.Enabled = True
End If
End Sub
把vb的代碼改寫成c#的代碼
uj5u.com熱心網友回復:
不要做A語言代碼修改為B語言代碼的無用功。也不要做用A語言代碼直接呼叫B語言代碼庫這樣復雜、這樣容易出錯的傻事。
只需讓A、B語言代碼的輸入輸出重定向到文本檔案,或修改A、B語言代碼讓其通過文本檔案輸入輸出。
即可很方便地讓A、B兩種語言之間協調作業。
比如:
A將請求資料寫到檔案a.txt,寫完后改名為aa.txt
B發現aa.txt存在時,讀取其內容,呼叫相應功能,將結果寫到檔案b.txt,寫完后洗掉aa.txt,改名為bb.txt
A發現bb.txt存在時,讀取其內容,讀完后洗掉bb.txt
以上A可以替換為任何一種開發語言或開發環境,B可以替換為任何一種與A不同的開發語言或開發環境。
除非A或B不支持判斷檔案是否存在、檔案讀寫和檔案更名。
但是誰又能舉出不支持判斷檔案是否存在、檔案讀寫和檔案更名的開發語言或開發環境呢?
可以將臨時檔案放在RamDisk上提高效率減少磨損磁盤。
資料的結構很復雜的話,文本檔案的格式問題可參考json或xml
共享臨時文本檔案這種行程之間的通訊方法相比其它方法的優點有很多,下面僅列出我現在能想到的:
·行程之間松耦合
·行程可在同一臺機器上,也可跨機,跨作業系統,跨硬體平臺,甚至跨國。
·方便除錯和監視,只需讓第三方或人工查看該臨時文本檔案即可。
·方便在線開關服務,只需洗掉或創建該臨時文本檔案即可。
·方便實作分布式和負載均衡。
·方便佇列化提供服務,而且幾乎不可能發生佇列滿的情況(除非硬碟空間滿)
·……
“跨語言、跨機,跨作業系統,跨硬體平臺,跨國,跨*.*的”苦海無邊,
回頭是“使用共享純文本檔案進行資訊交流”的岸!
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/69917.html
標籤:VB基礎類
