Вопрос

I have a line of code that I want to return all the rows in a dataset where a column has a name like

var rows = data.Tables[0].Select("Name like '" + username+ "['");

So basically I want to return all the rows where a column called Name has a username with a [ just after its

eg

John [Smith]
John [Kelly]

the function above should return both of these because there is a [ just after their name

Это было полезно?

Решение

Add '%' after '['

var rows = data.Tables[0].Select("Name like '" + username+ " [[]%'");
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top