Domanda

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

È stato utile?

Soluzione

Add '%' after '['

var rows = data.Tables[0].Select("Name like '" + username+ " [[]%'");
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top