like query in dataview (In asp.net with c#)

  • Thread starter Thread starter I want to use like query with dataview.
  • Start date Start date
I

I want to use like query with dataview.

I want to use sql server like query with dataview control in asp.net. any
body help me ?


Thanks in Advance
 
=?Utf-8?B?SSB3YW50IHRvIHVzZSBsaWtlIHF1ZXJ5IHdpdGggZGF0YXZpZXcu?= <I want
to use like query with (e-mail address removed)> wrote in
I want to use sql server like query with dataview control in asp.net.
any body help me ?

The simple method is to use a DataSource and hand write the LIKE query.
You then connect the source for the like (a textbox) as the control that
fills in the parameter.

If you want an additional "safety" step, write a stored procedure and
use with a DataSource.

If you want more control over the actual objects (for more background
check out http://snurl.com/txg9u), you will have to code them.

Basics:

Connection object = connection to the server
Command object = Command run on the server
Paramater object(s) = parameters for the command
Data Adapter = method of moving data from the data store to .NET objects
DataReader = forward only (firehose) cursor)

If you use datasets
===================
DataSet object = container for one or more data tables
DataTable object(s) = Individual result sets to be used (can be implied)
DataView object(s) = items bound to a form (can be implied by binding
DataTable or DataSet)

No time to go through EF and LINQ right now.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Try this

string AFilterExpression="Firstname like '" + txtName.Text + "'";

mydst.Tables[0].DefaultView.RowFilter = AFilterExpression;
 
Back
Top