Posted on: 4/12/2015 3:59:26 PM | Views : 646

Hi
I am trying to show 20 words max from my db into my label from code behind but it doesn't work, so may you help with this case please
if (!IsPostBack) { using (SqlConnection NewsSqlCon = new SqlConnection(sc)) { NewsSqlCon.Open(); SqlDataAdapter NewDAADP = new SqlDataAdapter(@"SELECT [Title], [Date], SUBSTRING([Descp],1,20) AS ShortDescp FROM [News] ORDER BY [Date] DESC", sc); DataSet NewsDS = new DataSet(); NewDAADP.Fill(NewsDS); NewsListView.DataSource = NewsDS.Tables[0]; NewsListView.DataBind(); } } else { // Your Session key could not be found, consider displaying an error ...

Go to the complete details ...