Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 20th, 2004, 02:40 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Substring in Datagrid

I have designed a datagrid in C#, I am retrieving all the values from database. But for one field the length of data is 5000 characters, now i want to display only 40 characters and after putting the mouse over the text of the column then i want to display the whole data.
Could u help me in this regard.



 
Old July 20th, 2004, 03:12 AM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

select field_1,field_2,left(field_3,40) from table_name



 
Old July 20th, 2004, 11:52 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What about using a hidden div. You could dump the entire string into the div, then when you mouse over the abbreviated text, you show the div to expose all of the text.
 
Old July 21st, 2004, 11:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

What App. u r running?! Web or Win?

Always:),
Hovik Melkomian.
 
Old July 22nd, 2004, 01:19 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got the answer, that will be substring(text,1,40)+'..' in the sql query.

 
Old July 22nd, 2004, 02:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Since u wana show whole data at end, u have to retrive all 500 Data, otherwise u'll have to retrive again then.
Hope it was clear...

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to cut a substring petergoodman XSLT 2 July 17th, 2008 06:29 AM
substring in c# sudhirbharti C# 1 February 21st, 2008 01:29 PM
substring-before() function. lafilip XSLT 1 July 11th, 2007 05:33 PM
Substring-after collation bonekrusher XSLT 2 May 11th, 2007 09:31 AM
SubString prasanta2expert Access VBA 1 November 17th, 2006 10:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.