none
宣告的語法是一樣的嗎? RRS feed

  • 問題

  • =================
    Q1:
    ================= 
    Dim WithEvents cnAccess As New OleDbConnection    這行我是書上看到的 WithEvents 是什麼  
     cnAccess.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"
     cnAccess.ConnectionString = cnAccess.ConnectionString &"Data Source=xxx.mdb;"
    ================================================================

    Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=xxx.mdb;User ID=;Password=;"
    Dim MyConn As New OleDbConnection(strConn)
    ===================================================================
    上面兩個是一樣的ㄇ?

    ===========================================
    Q2:下面這個是我在網路上找到的語法with end with 是不是還有什麼差別,為什麼我感覺不出來用with end with會比較好
    ===========================================

    Dim x As String = "Hello World"

    With x

        Console.Writeline(.Length())

        Console.Writeline(.ToString())

    End With

    範例: 不用With...End With

    Dim x As String = "Hello World"

        Console.Writeline(x.Length())

        Console.Writeline(x.ToString())

    ==================================
    Q3: 資料庫我之前有問過各位大哥 新增 刪除 修改了,那請問一下要查詢某依筆資料是要用SELECT的ㄇ?
    ==================================

    是用       SELECT "欄位名" FROM "表格名" WHERE "條件"

    還是用        SELECT "欄位名" FROM "表格名"

    我有看書上說他回傳回來是一個集合,那是要怎麼收集它阿?
    這樣就是所謂的讀到資料庫的資料了嗎?
    那DATAREADER是要做啥的?


     
    2009年5月19日 上午 05:20

解答

所有回覆