Re: Select statement in Asp.Net project?
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Mon, 13 Nov 2006 06:20:48 +0100
ArtMic,
Did you try it first in the Query analyzer what you want to achieve, that
you can always use in any DataAdapter select statement.
Cor
"ARTMIC" <ARTMIC@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:4C2FBE57-EF3A-4980-B3D6-978D75CD0ECB@xxxxxxxxxxxxxxxx
Hi,
well the problem is that if i add the parameter, i can't use something
like:
select * from comp where Name like '%@param1%'
when i try to call taComp.fill(dtComp); the extra parameter that should
appear after dtComp is not there anymore, if i remove the (like) keyword
and
use = instead it is ok. I need a closest match type of sql on this.
And i can't get access to the SelectCommand from my code? How can i
replace
that SelectCommand at runtime?
It used to be so easy with sqlDataAdapter controls, with Visual Studio
2003,
now it is a pain just getting a simple select going with Visual Studio
2005
Can you help out? How can a user expect to know a piece of information
exactly how it should be typed in the search box? i need that like keyword
sql select statement for searching a table with 5000 records.
"Miha Markic [MVP C#]" wrote:
Hi,
I guess you'll need to configure taComp adequately (its SelectCommand) -
add
a parameter or create dynamic sql statements.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
"ARTMIC" <ARTMIC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C8464AEF-9236-4B20-9827-D6830203F7A4@xxxxxxxxxxxxxxxx
I have the following code on my pageLoad event:
taComp = new dsCompTableAdapters.CompTableAdapter();
dtComp = new dsComp.CompDataTable();
taComp.Fill(dtComp);
WbGrid.DataSource = dtComp;
if (!this.IsPostBack)
{
WbGrid.DataBind();
}
OK the above works fine, but , i have a search textBox which i want
someone
to search for a specific record in my comp table,.... how can i allow
someone
to search for that record ?
they type some text in my search textBox, they click a button, and i
want
to
run an sql statement somehow against my datatable/tableAdapter/dataset
to
retrieve all matching records...
can anyone help me?
.
- References:
- Re: Select statement in Asp.Net project?
- From: Miha Markic [MVP C#]
- Re: Select statement in Asp.Net project?
- From: ARTMIC
- Re: Select statement in Asp.Net project?
- Prev by Date: Re: Two questions about moving data between a SQL DB and XML
- Next by Date: Re: Two questions about moving data between a SQL DB and XML
- Previous by thread: Re: Select statement in Asp.Net project?
- Next by thread: Two questions about moving data between a SQL DB and XML
- Index(es):