Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing Data Row column values and string values
Message
 
 
To
10/07/2013 11:39:45
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01578028
Message ID:
01578109
Views:
39
>>
>>foreach (KeyValuePair<String, String> kvp in rowValues)
>>         {
>>            String passedValue = kvp.Value.Trim();          //  I would not Trim() here.  Make sure the are Trimmed before they go in the dictionary
>>            string rowValue = bookingRow[kvp.Key].ToString().Trim();
>
>>            if ( passedValue != rowValue ) 
>>            {
>>   >                  this.SaveToBookingHistory(booking_id, "M", kvp.Key, rowValue , passedValue, ref messageText, ref statusCode);
>>            }
>>         }
I think they actually trimmed in the method that populates dictionary, I'll double check.

That was my original attempt but it doesn't work as rowValue will be 0 (in case of numeric) and my string value will be empty. This is why I started the whole business of attempting to convert to the proper type.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform