473,408 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Displaying fields in a datagrid

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:

<asp:DataGrid 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>

</asp:DataGrid>

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

Nov 19 '05 #1
0 859

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: pmud | last post by:
Hi, I have 4 columns in my sql database table. I added a data adapter , data set & a data grid to view this information. But the data grid is displaying those 4 columns TWICE , i.e in the data...
2
by: Rose | last post by:
Hi all, I'm a newbie to C# and .NET, so please be gentle! My limited background is in VBScript,ASP, and Access dbs. I need to retrieve data from a SQL server db (8.0) to be displayed in a...
12
by: Charles Astwood | last post by:
Hi, just starting out working my way round C Sharp and aspx. Used to write all my sites in asp and just need a few pointers in how to display data. I have made a connection to my SQL2000...
1
by: Michael Gorbach | last post by:
Iv got a StatisticsContainer object that contains an arraylist of objects of different types, all inherited from class Statistic. The statistics class has 2 string public properties, name and...
3
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls...
4
by: Tim T | last post by:
Hi, I have a stored procedure executing a search and an asp.net page displaying the results in a datagrid. The datagrid has paging on it, I am using Visual Studio.NET and can't see any option...
2
by: Fedor G via DotNetMonster.com | last post by:
Pls help me manage the data displaying on the webform aspx c# page. I used Dreamweaver to manage data displaying in the repeat table, ie simply dragged the fields to the table cells, where I need...
1
by: shelleybobelly | last post by:
Hi, I am trying to use the ItemCommand in a datagrid (web form) to display *fields* from the specific row. Each row in the dataset has a primary key. The dataset single table is filled from a...
3
by: BSB | last post by:
Hi, I use VB in front end and Access database at backend.... The fields in the database are updated by other application... On of the field is the Number (Cost) Column... The number in the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.