求助下数据库提取出来的问题
我在access 有个公式是这样的
变量 值 符号
长 24
宽 12 *
所写代码如下: Dim bl, fh As String
Dim gg As String = Request("Str").ToString
Dim strnmu = "select * from " + gg + ""
Dim Gdbcon As OleDbConnection
Gdbcon = getconnection()
Dim Gcmd As OleDbCommand = New OleDbCommand(strnmu, Gdbcon)
Dim Gsdr As OleDbDataReader
Gsdr = Gcmd.ExecuteReader
If Gsdr.HasRows() Then
While Gsdr.Read()
bl = String.Empty
z = String.Empty
fh = String.Empty
bl = Gsdr.GetValue(0)
z = Gsdr.GetValue(1)
fh = Gsdr.GetValue(2)
If ad = 0 Then
Label1.Text = bl
Label2.Text = CSng(z)
Else
Label3.Text &= bl & fh & Label1.Text
Select Case fh
Case "+"
num = CSng(z) + CSng(Label2.Text)
Case "-"
num = CSng(z) - CSng(Label2.Text)
Case "*"
num = CSng(z) * CSng(Label2.Text)
Case "/"
num = CSng(z) / CSng(Label2.Text)
End Select
select case fh // 这一块就直接跳过 select case ....end select 语句了。这是为什么啊,调试中 fh的值着实是"*"来着
[解决办法]
fh=fh.Trim()试试