Click here to Skip to main content
15,895,799 members
Home / Discussions / C#
   

C#

 
AnswerRe: Get value from dynamic checkboxes Pin
Richard Deeming7-Mar-14 9:07
mveRichard Deeming7-Mar-14 9:07 
GeneralRe: Get value from dynamic checkboxes Pin
NYCABR10-Mar-14 3:38
NYCABR10-Mar-14 3:38 
QuestionInterface and abstract class why we use Pin
rahulmaurya1237-Mar-14 5:19
rahulmaurya1237-Mar-14 5:19 
AnswerRe: Interface and abstract class why we use Pin
Peter Leow7-Mar-14 5:29
professionalPeter Leow7-Mar-14 5:29 
AnswerRe: Interface and abstract class why we use Pin
Jason Gleim7-Mar-14 5:31
professionalJason Gleim7-Mar-14 5:31 
AnswerRe: Interface and abstract class why we use Pin
Eddy Vluggen7-Mar-14 7:17
professionalEddy Vluggen7-Mar-14 7:17 
AnswerRe: Interface and abstract class why we use Pin
jschell7-Mar-14 9:23
jschell7-Mar-14 9:23 
QuestionReading a filepath string from a table field and escapes are automatically added. Pin
Doncal7-Mar-14 4:52
Doncal7-Mar-14 4:52 
Hi Guys,

Im trying to retrieve a part of a string (a filepath and name) from a field.
However when I do, c# "helpfully" automatically escapes the string.
So instead of the string: C:\folderpath\filename.doc
I end up with: C:\\folderpath\\filename.doc
I've tried using the string.Replace funciton to remove the extra rubbish, but nothing happens.
I've also tried using Regex, but it just complains that it doesnt know what "\f" is.
I've tried adding "@" to the beginning of the string retrieval, but that doesnt help either.

Im running a sql query
C#
using (SqlCommand cmd = new SqlCommand("Select Address1, Address2, LinkedDoc, Recid from Contsupp2 Where Rectype = 'L' AND U_ADDRESS1 Like @param", conn))
{
  cmd.Parameters.Add("param", SqlDbType.VarChar,10).Value = @"S:\RWE%";
  using (SqlDataReader reader = cmd.ExecuteReader())
  {
    txt.Clear();
    while (reader.Read())
    {
      string strOrigFilePath = (reader.GetString(2).Substring(reader.GetString(2).IndexOf("FILENAME=") + 9));



Any suggestions as to how I can return a normal string without c# messing it up?

Thanks
AnswerRe: Reading a filepath string from a table field and escapes are automatically added. Pin
Richard Deeming7-Mar-14 5:38
mveRichard Deeming7-Mar-14 5:38 
QuestionBank Transfer Form Pin
Cornille Michiel7-Mar-14 3:31
professionalCornille Michiel7-Mar-14 3:31 
Questionrefferences Pin
Mawande Ngoma7-Mar-14 2:38
Mawande Ngoma7-Mar-14 2:38 
AnswerRe: refferences Pin
Peter Leow7-Mar-14 3:05
professionalPeter Leow7-Mar-14 3:05 
Questiondatagridview: adding a combobox to a datagriedview dynamically at runtime , with a textbox as the last item. Pin
shrikanth_BG7-Mar-14 0:48
shrikanth_BG7-Mar-14 0:48 
AnswerRe: datagridview: adding a combobox to a datagriedview dynamically at runtime , with a textbox as the last item. Pin
Eddy Vluggen7-Mar-14 7:15
professionalEddy Vluggen7-Mar-14 7:15 
GeneralRe: datagridview: adding a combobox to a datagriedview dynamically at runtime , with a textbox as the last item. Pin
shrikanth_BG9-Mar-14 20:06
shrikanth_BG9-Mar-14 20:06 
Questionerror connection c# with oracle 11xe Pin
honar.cs6-Mar-14 21:28
honar.cs6-Mar-14 21:28 
AnswerRe: error connection c# with oracle 11xe Pin
Richard MacCutchan6-Mar-14 22:00
mveRichard MacCutchan6-Mar-14 22:00 
AnswerRe: error connection c# with oracle 11xe Pin
Pete O'Hanlon6-Mar-14 22:00
mvePete O'Hanlon6-Mar-14 22:00 
GeneralRe: error connection c# with oracle 11xe Pin
honar.cs7-Mar-14 1:14
honar.cs7-Mar-14 1:14 
QuestionExpandoObject and Serialization of Anonymous Types ? Pin
BillWoodruff6-Mar-14 15:48
professionalBillWoodruff6-Mar-14 15:48 
AnswerRe: ExpandoObject and Serialization of Anonymous Types ? Pin
Eddy Vluggen6-Mar-14 22:20
professionalEddy Vluggen6-Mar-14 22:20 
GeneralRe: ExpandoObject and Serialization of Anonymous Types ? Pin
BillWoodruff7-Mar-14 1:39
professionalBillWoodruff7-Mar-14 1:39 
AnswerRe: ExpandoObject and Serialization of Anonymous Types ? Pin
Eddy Vluggen7-Mar-14 6:49
professionalEddy Vluggen7-Mar-14 6:49 
GeneralRe: ExpandoObject and Serialization of Anonymous Types ? Pin
BillWoodruff7-Mar-14 14:11
professionalBillWoodruff7-Mar-14 14:11 
GeneralRe: ExpandoObject and Serialization of Anonymous Types ? Pin
Eddy Vluggen7-Mar-14 23:26
professionalEddy Vluggen7-Mar-14 23:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.