troubleshooting Question

How do you append data to a field (SQL) using LINQ

Avatar of kimmie8000
kimmie8000Flag for United States of America asked on
C#
5 Comments1 Solution259 ViewsLast Modified:
I have an array that could go up to 308 values.

In the SQL table where this data is stored is a multi-line text box.  So, the user in the web application can store any text.  They useable stored the data like this.

Apple
Orange
Carrot

Here is the problem.  I have been given a spreadsheet to update this particular <table> field with up to 308 values.  I know that I can just move in the value to the variable and do submitchanges(); and that will work.  However, I don't know how to do this with overwriting every value except the last in the field 308?

Thank you in advance.  
foreach (Test d in match)
                             {
                                 string[] StringArray = new string[5];
                                 StringArray[0] = b.EpicInbasket1;
                                 StringArray[1] = b.EpicInbasket2;
                                 StringArray[2] = b.EpicInbasket3;
                                 StringArray[3] = b.EpicInbasket4;
                                 StringArray[4] = b.EpicInbasket5;

                                 IEnumerable<string> result2 = from str in StringArray where str[0] != null select str;

                                 foreach (string str in result2)
                                   {
                                     // HOW DO I APPEND THIS AND NOT OVERWRITE??
                                     d.Message = (str);
                                     
                                     // submit changes to the database.
                                     tm.SubmitChanges();

                                     
                                    }

                                }
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros