I have a table call Reviws in that table I have column call Description so user can add the description. Now what I need is in that description paragraph need to ignore some words and display.
I have some words like
a
is
about
above
after
again
against
all
This is the sample paragraph.
Anuradhapura is a major city in Sri Lanka. It is the capital city of North Central Province, Sri Lanka and the capital of Anuradhapura District.
but I want display some words only like this
Anuradhapura major city Sri Lanka.capital city North Central Province, Sri Lanka capital Anuradhapura District.
This this how now I display my description
Review.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.BindGrid();
}
}
private void BindGrid()
{
string constr = "Data Source=(localdb)\\ProjectsV13;Initial Catalog=ReviewDB;Integrated Security=True";
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("SELECT Description, Place FROM Reviews"))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
}
Review.aspx
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" AllowPaging="true"
OnPageIndexChanging="OnPaging" PageSize="10">
<Columns>
<asp:BoundField ItemStyle-Width="500px" DataField="Description" HeaderText="Description" />
</Columns>
</asp:GridView>
</div>
</form>
</body>