Timberton4
New member
There's gridview and a button in my page. when i click on the button, i want to clear and change the gridview's data where the surname startswith "m". Here is my code but i get too many errors:
Dim db As New DataClasses1DataContext()
Dim mySelect = (db.SignUpInfos.Where(Function(m) m.Surname.StartsWith("m")).[Select](Function(m) m.Surname.ToString.Trim & ", " & m.Name.ToString.Trim And m.Id))
If mySelect Is Nothing Then
Exit Sub
End If
gridvSearch.DataSourceID = Nothing 'i wrote this code because i had a error (both datasource and source id can not.....)
gridvSearch.DataSource = mySelect
gridvSearch.DataBind()
Dim db As New DataClasses1DataContext()
Dim mySelect = (db.SignUpInfos.Where(Function(m) m.Surname.StartsWith("m")).[Select](Function(m) m.Surname.ToString.Trim & ", " & m.Name.ToString.Trim And m.Id))
If mySelect Is Nothing Then
Exit Sub
End If
gridvSearch.DataSourceID = Nothing 'i wrote this code because i had a error (both datasource and source id can not.....)
gridvSearch.DataSource = mySelect
gridvSearch.DataBind()