这是在我的 OfficeEquipment.Frm
Public Function Loadfunction()
dt = Functions.LoadData()
End Function
这是上面代码的错误
警告 1 函数“Loadfunction”不会在所有代码路径上返回值。使用结果时,可能会在运行时发生空引用异常。C:\Documents and Settings\IJDinglasan\My Documents\Visual Studio 2008\Projects\Electronic Office Equipment History\Electronic Office Equipment History\Update Office Equipment Profile.vb 9 5 电子办公设备历史
这是我的模块功能
Private Function LoadData() As DataTable
Using sqlconn = New SqlClient.SqlConnection("server = SKPI-APPS1;" & _
"Database = EOEMS;integrated security=true")
Dim dt As New DataTable
sqlconn.Open()
Dim da As New SqlDataAdapter("SELECT * FROM tblOfficeEquipmentProfile", sqlconn)
da.Fill(dt)
Return dt
End Using
End Function