四月三日
同样是看英语,看完英文文献感觉英语水平有进步,但程序的帮助文档为什么就没有?
看来,不管学什么,都是一个反复的过程。不懂的,看不明白的,只有反复弄明白了才会进步。
所以,以后查阅的文档,把链接保存下来,关键句子,回头再消化。
For conceptual information about using this namespace when programming with the .NET Framework
http://msdn.microsoft.com/en-us/library/system.data.oracleclient(v=vs.80).aspx
1 strCon = "user id=" & INIDefine.valueINI.USER 2 strCon = strCon & ";data source=" 3 strCon = strCon & INIDefine.valueINI.SID 4 strCon = strCon & ";password=" 5 strCon = strCon & INIDefine.valueINI.PASSWORD
注意字符串的拼接
1 DBOracle.SQLWhere = "CD_WORKER='" & strWorkerCD & "'"
怎样把编程速度提高?不能光靠网上查。
1 Public Function SearchWorker(ByVal strWorkerCD As String, _ 2 ByRef strWorkerName As String) As Integer 3 4 Dim lRet As Integer 5 6 Try 7 9 DBOracle.Clear() 10 DBOracle.SQLTable = "M_WORKER" 11 DBOracle.SQLSelect = "NA_WORKER" 12 DBOracle.SQLWhere = "CD_WORKER='" & strWorkerCD & "'" 13 DBOracle.MakeSqlStr(SELECT_SQL) 14 16 lRet = DBOracle.DynasetSql2() 17 19 If lRet = HAVE_DATA Then 20 strWorkerName = CStr(DBOracle.SQLResult2.Item("NA_WORKER")).Trim() 21 Else 22 strWorkerName = "" 23 End If
第十三行与第十六行区别?
1 Public Property SQLResult2() As OracleDataReader
属性过程定义as OracleDataReader?
site:msdn.microsoft.com oracledatareader
1 Public Shared Property DBOracle() As clsCmnDB
String.Trim Method ():Removes all occurrences of white space characters from the beginning and end of this instance
OracleTransaction Class:Represents a transaction to be made in the database
1 Public Sub Main() 2 Dim a() As String = {"P", "1P", "3N1"} 3 Dim i As Integer 4 Dim b As String = "PPARTS-0401-01" 5 For i = 0 To a.Length - 1 6 If b.StartsWith(a(i)) Then 7 b = b.Trim(a(i).ToArray) 8 End If 9 Next 10 Console.WriteLine(b) 11 Console.Read() 12 End Sub
注意Trim会把所有的p全部截掉,而不是只截一个。