Hi,
I'm having some difficulty with the following. I don't think it should be very complicated, it's just how to go about it!
What I am trying to do is compare a string to a pattern, if the string is like the pattern then copy the string from the dataGrid or dataList into, I was thinking another dataGrid or list, but I'm changing my mind to having a Response.Write().
I know that you can do IF string LIKE pattern THEN ...
I have the coding for getting the string in a dataGrid, where the dataGrid has been filled by an SQL query to the database.
AdvancedSolutions1 is the original dataGrid
txtBox is the textbox that the user enters the pattern into
Dim itm As DataGridItem
Dim cel As TableCell
Dim cellText As String
cellText = cel.Text
For Each itm In AdvancedSolutions1.Items
For Each cel In itm.Cells
If cellText LIKE txtBox Then
.
.
.
End If
Next
Next
I've tried things like AdvancedSolutions2.DataBind() where AdvancedSolutions2 is the name of the dataGrid that I'd like the text passed into.
I've also tried
Dim itm As DataListItem
Dim dlCell As TableCell
Dim cellText As String
Dim List As String
cellText = dlCell.Text
For Each dlCell In DataList1.Items
If cellText Like txtBox.Text Then
dlCell.Text.Copy(List)
End If
Next
Response.Write(List)
but the page wouldn't display with this one.
If anybody can help, or point me in the right direction it would be greatly appreciated, as I've been stuck with this problem for the last couple of weeks!
Thanks in advance
I'm having some difficulty with the following. I don't think it should be very complicated, it's just how to go about it!
What I am trying to do is compare a string to a pattern, if the string is like the pattern then copy the string from the dataGrid or dataList into, I was thinking another dataGrid or list, but I'm changing my mind to having a Response.Write().
I know that you can do IF string LIKE pattern THEN ...
I have the coding for getting the string in a dataGrid, where the dataGrid has been filled by an SQL query to the database.
AdvancedSolutions1 is the original dataGrid
txtBox is the textbox that the user enters the pattern into
Dim itm As DataGridItem
Dim cel As TableCell
Dim cellText As String
cellText = cel.Text
For Each itm In AdvancedSolutions1.Items
For Each cel In itm.Cells
If cellText LIKE txtBox Then
.
.
.
End If
Next
Next
I've tried things like AdvancedSolutions2.DataBind() where AdvancedSolutions2 is the name of the dataGrid that I'd like the text passed into.
I've also tried
Dim itm As DataListItem
Dim dlCell As TableCell
Dim cellText As String
Dim List As String
cellText = dlCell.Text
For Each dlCell In DataList1.Items
If cellText Like txtBox.Text Then
dlCell.Text.Copy(List)
End If
Next
Response.Write(List)
but the page wouldn't display with this one.
If anybody can help, or point me in the right direction it would be greatly appreciated, as I've been stuck with this problem for the last couple of weeks!
Thanks in advance