Posted on: 3/4/2015 5:24:47 PM | Views : 545

I am writing to seek help, in how I can extract certain length of string from database fieldname.  I would like to be able to extract the first sentence after the word pipe, from my database fieldname ‘body’. 
public static string testMethod() { string article = ""; string title = ""; string body = ""; using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["#######"].ConnectionString)) { string commandtext = "select top 1 TITLE, Body from StoryTbl"; SqlCommand command = new SqlCommand(commandtext, con); con.Open(); command.Parameters.Add(new SqlParameter("TITLE", title)); command.Parameters.Add(new SqlParameter("Body", body)); SqlDataReader reader = comma ...

Go to the complete details ...