6
Answers

How to select more colums with LIke

albert albert

albert albert

11y
920
1
HI everybody,

I have this:

[code]
 public void rep_bind()
        {

            DataClasses1DataContext context = new DataClasses1DataContext(_connectionString);
            var selectTrip = from t in context.TripElements
                             where SqlMethods.Like(textBox1.Text.Trim(), "%"+t.TripElementCode+"%" /*+ "%"+t.TripElementName + "%" +*/ + t.TripElementName.Contains(t.TripElementName))
                            // where SqlMethods.Like(textBox1.Text.Trim(), "%" + t.EMP_ID)
                             select new
                             {
                                 Trip_ID = t.TripElementID,
                                 Trip_Code = t.TripElementCode,
                                 trip_ElementName = t.TripElementName
                             };

            dataGridView1.DataSource = selectTrip;
            textBox1.Text = "";
        }
[/code]

But that doenst work.

THX for helping

Answers (6)