1

I am trying to populate data in gridview by using LinqDataSource and in the where condition of LinqDataSource1 - programmatically I am not sure about the syntax on how to pass a string value to a particular column?

What is the syntax for where condition in LinqDataSource on a string programmatically?

I am familiar with the one in int:

 int id = 5; 

for example:

LinqDataSource1.Where = "ID =" +id;

But, not sure about the syntax for string.

Please suggest something!

Vikram
  • 3,996
  • 8
  • 37
  • 58
Nalini
  • 213
  • 1
  • 3
  • 12
  • 1
    Can you please show the context of your question with relevant code? It is very difficult to understand what you are asking. – Jane S Jun 30 '14 at 23:22

1 Answers1

1

Ok, finally I got the syntax for string in LinqDataSource:

LinqDataSource1.Where = "Title.Contains("+ "\"" + txtTitle.Text + "\""+ ")";

Nalini
  • 213
  • 1
  • 3
  • 12