Greetings,
I am attempting to use the following code in order to create a DataView
(in VB.NET 2003). However, on the "Dim dv as New DataView" line I am
receiving a "Type expected" error. Any ideas?
Thanks in advance!
************************************************** ******
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim sqlConn As New SqlClient.SqlConnection
....
sqlComm.Connection = sqlConn
sqlComm.CommandText = "Select * from Books"
Dim da As New SqlClient.SqlDataAdapter
da.SelectCommand = sqlComm
Dim ds As New DataSet
Try
da.Fill(ds, "Books")
Dim dv As New DataView(ds.Tables("Books"), " ", "Author",
DataViewRowState.CurrentRows)
--"'Type Expected' error occurs here"
Dim frow As Integer
frow = dv.Find("Simpson")
ListBox1.Items.Add(dv(frow)("Author").ToString() & " " &
dv(frow)("Title").ToString())
Catch er As Exception
MsgBox(er.Message)
End Try
*** Sent via Developersdex http://www.developersdex.com ***