sql server 2008 tablehttp://forums.asp.net/t/1719109.aspx/1?sql+server+2008+tableTue, 13 Sep 2011 05:36:49 -040017191094591041http://forums.asp.net/p/1719109/4591041.aspx/1?sql+server+2008+tablesql server 2008 table <p>Hi....</p> <p>Please anyone can help me out for table's column properties.In my table there is Description column and the size must be 20nvarchar for description and when I present table data on the webpage I just want to show only 15nvarchar and the rest of 5nvarchar want to show as a dot dot dot(three dot) (eg.15...). 15 nvarchar ... please can anybody give me any idea for that coz i dont know how to write to be like that. please..thanks a lot</p> 2011-09-10T04:33:10-04:004591061http://forums.asp.net/p/1719109/4591061.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>You will need to write a function that takes in the string and returns a string with ... at the end. If you provide your code I could provide more specific information. Something like this:</p> <pre class="prettyprint">protected string DotDotDot(string dbstring) { if (dbstring.Length &gt; 15) dbstring = string.Format(&quot;{0}...&quot;, dbstring.Substring(0, 14)); return dbstring; }</pre> <p>It's likely you're using this in a datatable or gridview. you will need to bind with&nbsp;something like this &lt;%# DotDotDot(container[&quot;dbfield&quot;]); %&gt;</p> 2011-09-10T05:15:25-04:004591063http://forums.asp.net/p/1719109/4591063.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <pre class="prettyprint">you can also try like this protected string DotDotDot(string dbstring) { if (dbstring.Length &gt; 15) dbstring =dbstring.SubString(0,15)&#43;&quot;...&quot; ; return dbstring; }</pre> 2011-09-10T05:19:28-04:004591108http://forums.asp.net/p/1719109/4591108.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>Hi....</p> <p>I did try but the error comes out like that and the code that i use is</p> <p>protected string DotDotDot(string dbstring)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (dbstring.Length &gt; 15)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dbstring = dbstring.Substring(0, 15) &#43; &quot;...&quot;;<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return dbstring;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>&lt;ItemTemplate&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li style=&quot;background-color: #DCDCDC;color: #000000;&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Label ID=&quot;NameLabel&quot; runat=&quot;server&quot; Text='&lt;%# Eval(&quot;Name&quot;) %&gt;' /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;br /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Label ID=&quot;DescriptionLabel&quot; runat=&quot;server&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Text='&lt;%# DotDotDot(container[&quot;dbfield&quot;]); %&gt;' /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;br /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Price:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Label ID=&quot;PriceLabel&quot; runat=&quot;server&quot; Text='&lt;%# Eval(&quot;Price&quot;) %&gt;' /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;br /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/li&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ItemTemplate&gt;<br> <br> </p> <p></p> <h2><i>Compilation Error</i></h2> <p><span face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif " style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif"><span face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif " style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif"><b>Description: </b>An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. <br> <br> <b>Compiler Error Message: </b>CS1026: ) expected<br> <br> <b>Source Error:</b><br> <br> </span></span></p> <table bgcolor="#ffffcc" width="100%"> <tbody> <tr> <td></td> </tr> <tr> <td> <pre>Line 13: &lt;br /&gt; Line 14: Description: <span color="red" style="color:red">Line 15: &lt;asp:Label ID=&quot;DescriptionLabel&quot; runat=&quot;server&quot;<br></span>Line 16: Text='&lt;%# DotDotDot(container[&quot;dbfield&quot;]); %&gt;' /&gt; Line 17: &lt;br /&gt;</pre> </td> </tr> </tbody> </table> 2011-09-10T06:20:40-04:004591116http://forums.asp.net/p/1719109/4591116.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>Try removing the ; in your databinding .aspx code</p> 2011-09-10T06:32:10-04:004591130http://forums.asp.net/p/1719109/4591130.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>Nope......</p> <p>its still not working even i take out the ; in aspx. It shows the same complilation error...please..help me out...thanks</p> 2011-09-10T06:45:07-04:004591131http://forums.asp.net/p/1719109/4591131.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>Are you copying the container stuff?</p> <p>container[&quot;dbfield&quot;]) should be Eval(&quot;whateverfieldhere&quot;)</p> 2011-09-10T06:47:57-04:004591156http://forums.asp.net/p/1719109/4591156.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>Yes</p> <p>If i did Eval(&quot;Description&quot;) its not changing anything like before i want to be 15... if i did the one like DotDotDot(container[&quot;dbfield&quot;]) or Eval(&quot;dbfield&quot;) or DotDotDot(container[&quot;dbfield&quot;]); its show the compilation error. Please will you give me any idea.</p> 2011-09-10T07:11:54-04:004591161http://forums.asp.net/p/1719109/4591161.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>You are doing DotDotDot(Eval(&quot;Description&quot;))</p> <p>&nbsp;</p> 2011-09-10T07:19:39-04:004591170http://forums.asp.net/p/1719109/4591170.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>No...I didn't do like that...please can you give me anyidea here is my code again</p> <p>&lt;asp:ListView ID=&quot;ListView1&quot; runat=&quot;server&quot; DataKeyNames=&quot;Id&quot; OnPagePropertiesChanging=&quot;ListView1_PagePropertiesChanging&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ItemTemplate&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li style=&quot;background-color: #DCDCDC;color: #000000;&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Label ID=&quot;NameLabel&quot; runat=&quot;server&quot; Text='&lt;%# Eval(&quot;Name&quot;) %&gt;' /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;br /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Label ID=&quot;DescriptionLabel&quot; runat=&quot;server&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Text='&lt;%# Eval(&quot;Description&quot;) %&gt;' /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;br /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Price:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Label ID=&quot;PriceLabel&quot; runat=&quot;server&quot; Text='&lt;%# Eval(&quot;Price&quot;) %&gt;' /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;br /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/li&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ItemTemplate&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;LayoutTemplate&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ul ID=&quot;itemPlaceholderContainer&quot; runat=&quot;server&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li runat=&quot;server&quot; id=&quot;itemPlaceholder&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ul&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;div style=&quot;text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:DataPager ID=&quot;DataPager1&quot; runat=&quot;server&quot; PagedControlID=&quot;ListView1&quot;&nbsp; PageSize=&quot;5&quot; QueryStringField=&quot;pageNumber&quot; EnableViewState=&quot;true&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Fields&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:NextPreviousPagerField ButtonType=&quot;Button&quot; ShowFirstPageButton=&quot;True&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShowNextPageButton=&quot;False&quot; ShowPreviousPageButton=&quot;False&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:NumericPagerField /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:NextPreviousPagerField ButtonType=&quot;Button&quot; ShowLastPageButton=&quot;True&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ShowNextPageButton=&quot;False&quot; ShowPreviousPageButton=&quot;False&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Fields&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:DataPager&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/LayoutTemplate&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:ListView&gt;</p> <p></p> <p>the code behind is</p> <p>protected string DotDotDot(string dbstring)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (dbstring.Length &gt; 15)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dbstring = dbstring.Substring(0, 15) &#43; &quot;...&quot;;<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return dbstring;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>it doesnt work nothing change at all...thanks</p> <p></p> 2011-09-10T07:26:45-04:004591176http://forums.asp.net/p/1719109/4591176.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>I think I should change in sql database table's column properties to appear like that...but i am not sure..please give me idea</p> 2011-09-10T07:32:19-04:004591177http://forums.asp.net/p/1719109/4591177.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>What does this produce?</p> <p>&nbsp;</p> <pre class="prettyprint">&lt;asp:ListView ID=&quot;ListView1&quot; runat=&quot;server&quot; DataKeyNames=&quot;Id&quot; OnPagePropertiesChanging=&quot;ListView1_PagePropertiesChanging&quot;&gt; &lt;ItemTemplate&gt; &lt;li style=&quot;background-color: #DCDCDC;color: #000000;&quot;&gt; Name: &lt;asp:Label ID=&quot;NameLabel&quot; runat=&quot;server&quot; Text='&lt;%# Eval(&quot;Name&quot;) %&gt;' /&gt; &lt;br /&gt; Description: &lt;asp:Label ID=&quot;DescriptionLabel&quot; runat=&quot;server&quot; Text='&lt;%# DotDotDot(Eval(&quot;Description&quot;)) %&gt;' /&gt; &lt;br /&gt; Price: &lt;asp:Label ID=&quot;PriceLabel&quot; runat=&quot;server&quot; Text='&lt;%# Eval(&quot;Price&quot;) %&gt;' /&gt; &lt;br /&gt; &lt;/li&gt; &lt;/ItemTemplate&gt; &lt;LayoutTemplate&gt; &lt;ul ID=&quot;itemPlaceholderContainer&quot; runat=&quot;server&quot; style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt; &lt;li runat=&quot;server&quot; id=&quot;itemPlaceholder&quot; /&gt; &lt;/ul&gt; &lt;div style=&quot;text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;&quot;&gt; &lt;asp:DataPager ID=&quot;DataPager1&quot; runat=&quot;server&quot; PagedControlID=&quot;ListView1&quot; PageSize=&quot;5&quot; QueryStringField=&quot;pageNumber&quot; EnableViewState=&quot;true&quot;&gt; &lt;Fields&gt; &lt;asp:NextPreviousPagerField ButtonType=&quot;Button&quot; ShowFirstPageButton=&quot;True&quot; ShowNextPageButton=&quot;False&quot; ShowPreviousPageButton=&quot;False&quot; /&gt; &lt;asp:NumericPagerField /&gt; &lt;asp:NextPreviousPagerField ButtonType=&quot;Button&quot; ShowLastPageButton=&quot;True&quot; ShowNextPageButton=&quot;False&quot; ShowPreviousPageButton=&quot;False&quot; /&gt; &lt;/Fields&gt; &lt;/asp:DataPager&gt; &lt;/div&gt; &lt;/LayoutTemplate&gt; &lt;/asp:ListView&gt; the code behind is protected string DotDotDot(string dbstring) { if (dbstring.Length &gt; 15) dbstring = dbstring.Substring(0, 15) &#43; &quot;...&quot;; return dbstring; }</pre> 2011-09-10T07:32:49-04:004591181http://forums.asp.net/p/1719109/4591181.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>Nothing happen in my description name its still show all character not like with dotdotdot(15...) the one 15nvarchar...</p> 2011-09-10T07:40:16-04:004591184http://forums.asp.net/p/1719109/4591184.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>If you set a break point in the DotDotDot function does it get called? Can you paste your updated code? Can you also paste the output you're seeing and the HTML source</p> 2011-09-10T07:47:38-04:004591196http://forums.asp.net/p/1719109/4591196.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>the code that you show me before it shows the compilation error ( which means you ask me if i run the code what happen ) I means it shows error the code that you said</p> 2011-09-10T08:02:00-04:004591389http://forums.asp.net/p/1719109/4591389.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>Hi...</p> <p>Can anybody help me out for this...please</p> 2011-09-10T12:30:37-04:004591913http://forums.asp.net/p/1719109/4591913.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p></p> <blockquote><span class="icon-blockquote"></span> <h4>kyithar</h4> <p></p> <p>I think I should change in sql database table's column properties to appear like that...but i am not sure..please give me idea</p> <p></p> </blockquote> <p></p> <p>Change the Select statement for your datasource to something like this:</p> <pre class="prettyprint">SELECT *, LEFT(Description,15) &#43; CASE WHEN LEN(Description) &gt; 15 THEN '...' ELSE '' END AS ShortDescription FROM MyTable</pre> <p>Then you can reference ShortDescription in your ListView.</p> 2011-09-11T06:36:44-04:004592998http://forums.asp.net/p/1719109/4592998.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>No...please following code is not working as well.</p> <pre class="prettyprint">SELECT *, LEFT(Description,15) &#43; CASE WHEN LEN(Description) &gt; 15 THEN '...' ELSE '' END AS ShortDescription FROM MyTable Can anybody help me out .. pls..thanks</pre> 2011-09-12T09:17:18-04:004594058http://forums.asp.net/p/1719109/4594058.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p></p> <blockquote><span class="icon-blockquote"></span> <h4>kyithar</h4> <p></p> <p>No...please following code is not working as well.</p> <pre class="prettyprint">SELECT *, LEFT(Description,15) &#43; CASE WHEN LEN(Description) &gt; 15 THEN '...' ELSE '' END AS ShortDescription FROM MyTable Can anybody help me out .. pls..thanks</pre> <p></p> </blockquote> <p></p> <p>Can you please show us your original code for the ListView and SqlDataSource?</p> 2011-09-12T21:33:10-04:004594385http://forums.asp.net/p/1719109/4594385.aspx/1?Re+sql+server+2008+tableRe: sql server 2008 table <p>try this,<br> <br> SELECT *, CASE WHEN LEN(Description) &gt; 15 THEN CONVERT(varchar(15), description)&#43; '...' ELSE&nbsp; description END AS ShortDescription <br> FROM MyTable</p> 2011-09-13T05:36:49-04:00