Replacing a specified nvarchar string in database column with a carriage return in sql-ce

StackOverflow https://stackoverflow.com/questions/21983810

  •  15-10-2022
  •  | 
  •  

문제

When not using the nvarchar and replacing with another string i.e.'test' I get the expected replacing results. I am attempting to insert a carriage return

private void reformatData(SqlCeConnection conn)
    {
        try
        {
            SqlCeCommand comm = new SqlCeCommand("UPDATE database " + "SET column = replace(MoodLog, '[ret]', nvarchar(13));", conn);
            comm.ExecuteNonQuery();
        }
        catch (SqlCeException ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }
도움이 되었습니까?

해결책

Use the nchar function, no nvarchar function with SQL Server Compact:

http://technet.microsoft.com/en-us/library/ms174852.aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top