can any one tell me how to use the Trim() function in C# for any column in a table
-
string str = "SELECT cr_name, Trim(cr_pic), FROM criminal"; cr_pic contains image URL "E:\images\abc.jpg" i want to trim "E:\" Is this possible and what will be the way to do so
update the table (I mean use the sql query) Can u solve]
-
update the table (I mean use the sql query) Can u solve]
i want to use the trip function in such scenerio SqlConnection conPubs; SqlCommand sc; SqlDataReader dr; conPubs = new SqlConnection("server=localhost;User ID=sa;Password=sasa;database=rescue15"); conPubs.Open(); string str = "SELECT cr_name, Trim(cr_pic), Trim(fing_print) FROM criminal ORDER BY cr_id DESC"; sc = new SqlCommand(str, conPubs); dr = sc.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); but i thing i am not using correct sytax fot Trim() can u guide me in this scenario plz
-
string str = "SELECT cr_name, Trim(cr_pic), FROM criminal"; cr_pic contains image URL "E:\images\abc.jpg" i want to trim "E:\" Is this possible and what will be the way to do so
Try to write a short subject line for your post. Putting the entire question in the subject line makes it too long to be useful. You can't use C# functions in SQL. The
Trim
function is used to remove spaces at the beginning and end of a string. What you need is a function likeSubstring
. Look in the documentation for the SQL syntax of the database you are using.--- single minded; short sighted; long gone;
-
string str = "SELECT cr_name, Trim(cr_pic), FROM criminal"; cr_pic contains image URL "E:\images\abc.jpg" i want to trim "E:\" Is this possible and what will be the way to do so
you can use the following query... string str = "Select cr_name, substring(cr_pic,4,len(cr_pic)-4) from criminal"
“The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”
-
string str = "SELECT cr_name, Trim(cr_pic), FROM criminal"; cr_pic contains image URL "E:\images\abc.jpg" i want to trim "E:\" Is this possible and what will be the way to do so
you can use the following query... string str = "Select cr_name, substring(cr_pic,4,len(cr_pic)-4) from criminal"
“The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”