请各位大大看看到底是怎么回事?
这是我的代码:
Function CreateDataView() As DataView
Dim cn As New OleDbConnection
cn = New OleDbConnection(Session("connstr").ToString())
Dim SourceTable, SelectCommand As String
If Application("Subject") = "计算机" Then
SourceTable = "jsjQuestion"
SelectCommand = "Select * From jsjQuestion"
ElseIf Application("Subject") = "政治" Then
SourceTable = "zhengzhiquestion"
SelectCommand = "Select * From zhengzhiquestion"
End If
Dim MyCommand = New OleDbDataAdapter(SelectCommand, cn)
Dim DS As DataSet = New DataSet
MyCommand.Fill(DS, SourceTable)
CreateDataView = DS.Tables(SourceTable).DefaultView
End Function
调试时总是出现这句话
Fill: 应当为 SourceTable 名称输入一个非空字符串。参数名: srcTable
请大家帮帮忙看看是什么地方错了啊!