473,387 Members | 1,863 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,387 software developers and data experts.

Displaying records 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

Jul 21 '05 #1
0 1063

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

Similar topics

2
by: VM | last post by:
When I display data to a Windows datagrid I usually fill the underlying table (in another class) and then, once it contains all the data, I attach it to the grid. But there are some processes that...
1
by: sups sups via .NET 247 | last post by:
Hi.. I have two tables one called State and the other called City. State City State_ID City_ID State_Name City_Nm State_ID and so on.. I have created 2 datagrids.
0
by: Fronky | last post by:
Hope someone can help. I am still learning, so no laughing please. I am displaying records from a database using Response.Write(""); instead of the usual datagrid method. I am doing it this way...
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: Bidarkota | last post by:
I need to Display DataGrid Headers and the "no records" message when the DataGrid is empty, is there any way to achieve this. Thank you
0
by: .Net Sports | last post by:
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...
0
by: latin & geek via DotNetMonster.com | last post by:
hi! ok, im working on a database application. ive successfully managed to establish a relationship between two tables and display them on a datagrid, edit and add new records to them. now i...
1
by: sushant2009 | last post by:
Hi , I want to display empty databae table(actually table contains lot of records) to datagrid using dataset and dataadpter. After displaying i will fill new records in datagrid and i will save...
1
by: Deepmala26 | last post by:
Hi, I m doing a project in VB.NET. I've created form and database connectivity is done. I've displayed data in Datagrid through which user can sort and find records. for finding...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.