Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dataset question please

Status
Not open for further replies.

Ahssan

Programmer
Nov 4, 2003
27
KW
Hi All,

Im trying to search a record from an dataset this is my code

Dim temptable As DataTable
temptable = ds.Tables("Customers")

Dim dv As New DataView(temptable)
dv.Sort = "LLID"
Dim i As Integer = dv.Find(customers.SelectedValue)

If i = -1 Then
Response.Write("not found")
Else
Response.Write("found")
End If

every time i run this it gives me error on "dv.sort = "LLID"" that datatable should be set prior to use this function. I dont know what it means as from the code the table is set. what else has to be set or if some one has better idea the please assist me solving this.

Thankyou
 
In the SDK documentation regarding the DataView.Sort property, th following is stated;
Property Value
A string containing the column name followed by "ASC" (ascending) or "DESC" (descending). Columns are sorted ascending by default. Multiple columns can be separated by commas.

I notice you don't have 'ASC' or 'DESC' in your code.

Rhys
"There are some oddities in the perspective with which we see the world. The fact that we live at the bottom of a deep gravity well, on the surface of a gas-covered planet going around a nuclear fireball 90 million miles away and think this to be normal is obviously some indication of how skewed our perspective tends to be"
DOUGLAS AD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top