我是一個家庭學校的代碼作家,不是很技術。我試圖使用VB在Visual Studio 2013中使用sqlite訪問s3db文件。我不斷收到此錯誤信息 「類型‘System.IO.FileLoadException’未處理的異常發生在sqlite.exe在Visual Studio 2013中的sqlite錯誤消息system.io.fileloadexception
其他信息:混合模式組件對運行時的版本‘V2.0.50727’建成並不能加載到4.0運行時沒有額外的配置信息。「
代碼如下,調試器指向loadpropertydata()
進口System.Data.SQLite 公共類listboxpropertydata
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
loadpropertydata()
End Sub
Public Sub loadpropertydata()
Dim connectionString As String = "data source=c:\users\andy\documents\a la mode\database\spectrum.s3db"
Dim mSQL As String = "select AD_ADDR1, AD_ADDR2, PR_SALEPR1, SC_SOURCE1, SC_SOURCE2, FN_CONC1,FN_CONC2, DT_SALTIM1, LC_LOCAT1, RG_RIGHTS, ST_SITSIZE, ST_SITEVW,DA_DESAPL1, DA_CONSTQL, AG_AGYRBLT, AG_COND1, RM_TOTAL, RM_BED,RM_BATH, SF_GLA, BM_BSM1, BM_BSM2, FU_FUNCTUT, HC_HTCOOL, EE_EFFIC1,CR_GARPRK1, PF_PORPAT1, BL_BLANK1, BL_BLANK2, BL_BLANK3, HS_PRIOR1,HS_PRIOR2, HS_PRIOR3, HS_DSDATE from TOTALFormSource"
Dim dt As DataTable = Nothing
Dim ds As New DataSet
Try
Using con As New SQLiteConnection(connectionString)
Using cmd As New SQLiteCommand(mSQL, con)
con.Open()
Using da As New SQLiteDataAdapter(cmd)
da.Fill(ds)
dt = ds.Tables(0)
End Using
End Using
End Using
listboxsqlresults.valuemember = "PropertyGrid"
listboxsqlresults.displaymember = "Address"
listboxsqlresults.datasource = dt
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
末級
謝謝我弄明白了 – user3701191 2014-12-14 14:37:30
你怎麼想的? – 2014-12-15 06:37:54
是的謝謝你的幫助 – user3701191 2014-12-31 14:21:43