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

July 20th, 2004, 02:40 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

July 20th, 2004, 03:12 AM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
select field_1,field_2,left(field_3,40) from table_name
|
|

July 20th, 2004, 11:52 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
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.
|
|

July 21st, 2004, 11:46 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
What App. u r running?! Web or Win?
Always:),
Hovik Melkomian.
|
|

July 22nd, 2004, 01:19 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I got the answer, that will be substring(text,1,40)+'..' in the sql query.
|
|

July 22nd, 2004, 02:57 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
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.
|
|
 |