Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Displaying records in a datagrid

Reply
Thread Tools

Displaying records in a datagrid

 
 
.Net Sports
Guest
Posts: n/a
 
      05-16-2005
I'm able to display the lname and fname variables in my datagrid ,
using the below sql string


strSQLQuery = "SELECT fname + ' ' + lname AS Name, cust_id " _
& "FROM tblcusttag " _
& "WHERE lname LIKE '%" & Replace
(strSearch, "'", "''") _
& "%' " _
& "AND fname LIKE '%" & strSearch2 _
& "%' " _
& "ORDER BY lname;"


users enter both a first name and last name in 2 text boxes. In another

script with the sql string:


strSQLQuery = "SELECT fname + ' ' + lname AS Name, phoneNum, cust_id "
_
& "FROM tblcusttag " _
"WHERE phoneNum LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "ORDER BY lname;"


and only using an input box for the users to enter a phone number to
query, I do not see the Name (or lname nor fname) in the Datagrid
display:


<aspataGrid id="dgCustName" runat="server"
Headerstyle-BackColor="#48546a*"
Headerstyle-ForeColor="#c0c0c0*"
Headerstyle-Font-Name="Arial"
Headerstyle-Font-Size="14"
Headerstyle-Font-Bold="true"
/>


<columns>


<asp:BoundColumn
DataField="cust_id"
HeaderText="Customer ID"
ReadOnly="true">
</asp:BoundColumn>


<asp:BoundColumn
DataField="Lname"
HeaderText="Last Name">
</asp:BoundColumn>


<asp:BoundColumn
DataField="Fname"
HeaderText="First Name">
</asp:BoundColumn>


<asp:BoundColumn
DataField="phoneNum"
HeaderText="Phone #">
</asp:BoundColumn>
</columns>


</aspataGrid>


The datagrid is configured the same exact way for the
firstName/lastname script; both customer ids are displayed in each of
the datagrids
TIA
..netSports

 
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
Simple query returns 0 records in asp, but all records in vbscript masg0013@gmail.com ASP General 3 11-02-2006 09:23 AM
displaying records with many fields Lisa Calla ASP .Net 5 10-10-2005 01:15 PM
Delete records or update records Dan ASP General 1 05-10-2004 01:25 PM
match muliple header records to associated detail records Luke Airig XML 0 12-31-2003 12:06 AM
Displaying DB records in Servlet using a method Mohammed Mazid Java 4 11-30-2003 03:16 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57