hi,
i have a link button.i binded that link button in repeter.i am showing only some text in link button.after clicking the link button i am showing all data.
but,
my problem is when i am showing data in linkbutton it has to ends with complete word.
for example,
.net developed by microsoft(it has to end like this).
.net is developed by m.....(not like this)
i dont know how to do.
can you plz help me.
thank you,
in advance
Loading
Satyapriya NayakPosted Oct 17, 2011, 9:10 AM
Try this.....
Run the attachments.....
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
string connStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlCommand com;
SqlDataAdapter sqlda;
DataSet ds;
string str;
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(connStr);
con.Open();
str = "select * from student";
com = new SqlCommand(str, con);
sqlda = new SqlDataAdapter(com);
ds = new DataSet();
sqlda.Fill(ds, "student");
Repeater1.DataMember = "student";
Repeater1.DataSource = ds;
Repeater1.DataBind();
con.Close();
}
}
Thanks
If this post helps you mark it as answer
Dhaval PatelPosted Oct 17, 2011, 7:55 AM
for example
string s = ".net developed by microsoft";
string d = s.Substring(1, 18)+"...";
response.write(d.ToString());
Remove substring function either sql query or your database logic in your code then solve your error.