在vb.net2005中出现这样问题:变量“selestr”在赋值前被使用。可能会运行时导致空引异常。在vb.net2003没
DimschnameAsString=Trim(TextBox1.Text)DimselestrAsStringDimdvresultAsDataView=TushuDa...
Dim schname As String = Trim(TextBox1.Text)
Dim selestr As String
Dim dvresult As DataView = TushuDataSet2.writer.DefaultView
If schname <> "" Then
If rbtnexa.Checked = True Then
selestr = "作者名='" & schname & "'"
DataGrid1.Visible = True
DataGrid2.Visible = False
DataGrid4.Visible = False
DataGrid3.Visible = False
Else
selestr = "作者名='" & schname & "'"
End If
Else
MsgBox("请输入信息", 64, "提示")
End If
dvresult.Sort = "作者编号"
dvresult.RowFilter = selestr
dvresult.RowStateFilter = DataViewRowState.CurrentRows
DataGrid1.DataSource = dvresult
我使的是05的。但是,查找的时候,真的乱了。。。 展开
Dim selestr As String
Dim dvresult As DataView = TushuDataSet2.writer.DefaultView
If schname <> "" Then
If rbtnexa.Checked = True Then
selestr = "作者名='" & schname & "'"
DataGrid1.Visible = True
DataGrid2.Visible = False
DataGrid4.Visible = False
DataGrid3.Visible = False
Else
selestr = "作者名='" & schname & "'"
End If
Else
MsgBox("请输入信息", 64, "提示")
End If
dvresult.Sort = "作者编号"
dvresult.RowFilter = selestr
dvresult.RowStateFilter = DataViewRowState.CurrentRows
DataGrid1.DataSource = dvresult
我使的是05的。但是,查找的时候,真的乱了。。。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询