A
Alex
Hey Everyone,
1: Public Function GetCustomerInfo(ByVal intCustomerID as Integer) as
DataView
2: Dim dtCustomerInfo As DataTable = _dtCustomerInfo
3: Dim dvCustomerInfo As DataView = _
4: dtCustomerInfo.DefaultView.RowFilter = "CustomerID= " +
CStr(intCustomerID)
5: Return dvCustomerInfo
Does anyone see an issue with these two statements? _dtCustomerInfo
is a datatable being populated earlier in the class, but I don't want
to modify the Defaultview so I created dtCustomerInfo to do the dirty
work within this function. The error I'm getting is this on line 4
(Entire line is underlined):
Value of type 'Boolean' cannot be converted to 'System.Data.DataView'.
It's acting like dtCustomerInfo.DefaultView.RowFilter = "CustomerID= "
+ CStr(intCustomerID) is of type Boolean instead of DataView. What am
I doing wrong? I even tried just using this;
dtCustomerInfo.DefaultView.RowFilter = "CustomerID=1"
.... but I get the same results.
Any suggestions? This is a WinForm using Visual Basic 2005.
Alex
1: Public Function GetCustomerInfo(ByVal intCustomerID as Integer) as
DataView
2: Dim dtCustomerInfo As DataTable = _dtCustomerInfo
3: Dim dvCustomerInfo As DataView = _
4: dtCustomerInfo.DefaultView.RowFilter = "CustomerID= " +
CStr(intCustomerID)
5: Return dvCustomerInfo
Does anyone see an issue with these two statements? _dtCustomerInfo
is a datatable being populated earlier in the class, but I don't want
to modify the Defaultview so I created dtCustomerInfo to do the dirty
work within this function. The error I'm getting is this on line 4
(Entire line is underlined):
Value of type 'Boolean' cannot be converted to 'System.Data.DataView'.
It's acting like dtCustomerInfo.DefaultView.RowFilter = "CustomerID= "
+ CStr(intCustomerID) is of type Boolean instead of DataView. What am
I doing wrong? I even tried just using this;
dtCustomerInfo.DefaultView.RowFilter = "CustomerID=1"
.... but I get the same results.
Any suggestions? This is a WinForm using Visual Basic 2005.
Alex