Note that there are some explanatory texts on larger screens.

plurals
  1. POSQL Server CE 3.5 cuts off strings early (C#)
    primarykey
    data
    text
    <p>Hey Everyone, I am writing some code that makes use of SQL Server CE 3.5 and I am having a very strange problem. I have a string field in one of the tables that needs to store a full file path.</p> <p>Over the course of trying to fix this problem I have that field set as <code>nvarchar</code> with a max size of 4000, but it is still cutting longer strings that are much shorter than the limit off</p> <p>for example:</p> <pre><code>D:\iTunes\iTunes Media\Music\Abigail Williams\In The Absence Of Light\02 Final Destiny Of The Gods.m </code></pre> <p>This is clearly smaller than 4000 characters, yet it is missing the <code>p3</code> at the end of the string.</p> <p>I am using a table adapter to enter the data into the database with the following query:</p> <pre><code>INSERT INTO [Track] ([Artist_ID], [Album_ID], [FilePath], [LastUpdate]) VALUES (@Art, @Al, @Fp, @LU) </code></pre> <p>I know that the strings are fully formed on insert because I am using the following code to check:</p> <pre><code>if(!temp.Filepath.EndsWith(".mp3")) MessageBox.Show("File Error"); this.trackTableAdapter1.InsertQuery(ArtID, AlID, temp.Filepath, File.GetLastWriteTime(temp.Filepath)); </code></pre> <p>The message box does not get shown, so the string must end correctly on insert.</p> <p>the query that extracts the data is:</p> <pre><code>SELECT * FROM Track WHERE Artist_ID=@Artist_ID AND Album_ID=@Album_ID </code></pre> <p>The involved code is:</p> <pre><code>foreach (Database.MusicDBDataSet.TrackRow TR in this.trackTableAdapter1.GetAlbumTracks(AR.Artist_ID, AlR.Album_ID).Rows) { //if (!TR.FilePath.EndsWith(".mp3")) //MessageBox.Show("File Path Error"); this.ArtistList[AR.Name].AlbumList[this.ArtistList[AR.Name].AlbumList.Count - 1].TrackList.Add(new Track(TR.FilePath, AlR.Name, AR.Name)); } </code></pre> <p>Has anyone ever run into this problem before?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload