Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Select statement

Reply
Thread Tools

Select statement

 
 
VJ
Guest
Posts: n/a
 
      03-30-2006
SELECT [Department], [Last_Name], [First_Name], [Title], [Extension]
FROM [temployees] WHERE (([Department] = @Department) OR ([First_Name]
LIKE '%' + @First_Name + '%'))

this is my sql statement on my GridView but I can't get the values to
display?

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
 
Reply With Quote
 
 
 
 
sirfunusa
Guest
Posts: n/a
 
      03-30-2006
Are you getting an error? Do other sql statements on other gridviews
work? How are you passing in those parameters? Do hard-coded sql
statements work?

 
Reply With Quote
 
 
 
 
Patrick.O.Ige
Guest
Posts: n/a
 
      03-31-2006
Show some snippet code and you will get an answer
Patrick

"VJ" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> SELECT [Department], [Last_Name], [First_Name], [Title], [Extension]
> FROM [temployees] WHERE (([Department] = @Department) OR ([First_Name]
> LIKE '%' + @First_Name + '%'))
>
> this is my sql statement on my GridView but I can't get the values to
> display?
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com



 
Reply With Quote
 
vncntj@hotmail.com
Guest
Posts: n/a
 
      03-31-2006
This is my sqldatasource.....

<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:dbPMAEventsConnectionString %>"
SelectCommand="SELECT [Department], [Last_Name], [First_Name],
[Title], [Extension] FROM [temployees] WHERE (([Department] =
@Department) OR ([First_Name] LIKE '%' + @First_Name + '%'))">
<SelectParameters>
<asp:ControlParameter ControlID="dpdDepartment"
Name="Department" PropertyName="SelectedValue"
Type="String" />
<asp:FormParameter FormField="txtFirstName"
Name="First_Name" Type="String" />
</SelectParameters>
</asp:SqlDataSource>


but the gridview gives me NO data at all

<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" DataSourceID="SqlDataSource2"
Font-Names="Arial" Font-Size="Smaller" Style="z-index: 109;
left: 140px; position: absolute;
top: 314px" Width="800px">

thanks
v

 
Reply With Quote
 
Patrick.O.Ige
Guest
Posts: n/a
 
      04-01-2006
Have you tried your SQL statement using Query Analyzer?
Pls do that and is it possible to move your Sql statement to a stored
procedure
PAtrick
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> This is my sqldatasource.....
>
> <asp:SqlDataSource ID="SqlDataSource2" runat="server"
> ConnectionString="<%$ ConnectionStrings:dbPMAEventsConnectionString %>"
> SelectCommand="SELECT [Department], [Last_Name], [First_Name],
> [Title], [Extension] FROM [temployees] WHERE (([Department] =
> @Department) OR ([First_Name] LIKE '%' + @First_Name + '%'))">
> <SelectParameters>
> <asp:ControlParameter ControlID="dpdDepartment"
> Name="Department" PropertyName="SelectedValue"
> Type="String" />
> <asp:FormParameter FormField="txtFirstName"
> Name="First_Name" Type="String" />
> </SelectParameters>
> </asp:SqlDataSource>
>
>
> but the gridview gives me NO data at all
>
> <asp:GridView ID="GridView1" runat="server"
> AutoGenerateColumns="False" DataSourceID="SqlDataSource2"
> Font-Names="Arial" Font-Size="Smaller" Style="z-index: 109;
> left: 140px; position: absolute;
> top: 314px" Width="800px">
>
> thanks
> v
>



 
Reply With Quote
 
sirfunusa
Guest
Posts: n/a
 
      04-03-2006
Sorry, can't help you if you don't answer my original questions.

 
Reply With Quote
 
neilmcguigan@gmail.com
Guest
Posts: n/a
 
      04-03-2006
You can't use an expression in the select statement

you'll have to take out the "+" signs

 
Reply With Quote
 
neilmcguigan@gmail.com
Guest
Posts: n/a
 
      04-03-2006
er, you can't use an expression in the declarative property of the
sqldatasource i mean

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statement that, when false, skips first statement in its block, executes second? Jay McGavren Java 11 01-16-2006 05:49 PM
How do I do a conditional statement in a constant statement? tkvhdl@gmail.com VHDL 3 12-16-2005 06:13 PM
exec "statement" VS. exec "statement in globals(), locals() Ted Python 1 07-22-2004 08:51 AM
exec "statement" VS. exec "statement" in globals(), locals() tedsuzman Python 2 07-21-2004 08:41 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments