Click here to Skip to main content
16,021,041 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
string _shipId = string.Empty;
 decimal[] _SelectShipIId;
 foreach (ShippingCarrierDTO _ship in _site.ShipVia)
 {
   if (string.IsNullOrEmpty(_shipId))
 {
  _shipId = Convert.ToString(_ship.ShipIId);
 }
 else
 {
   _shipId += "," + Convert.ToString(_ship.ShipIId);
 }
}
 
 _SelectShipIId =new decimal[_shipId.Length];
 for (int i = 0; i < _shipId.Length; i++)
 {
  _SelectShipIId[i] = _shipId[i];
 }

_shipid am getting the value is 2.
but the am passing the _shipid value to decimal[] _SelectShipIId
at the time the decimal[] _SelectShipIId is getting another value that is 50..

I need what am having the value in _shipid the same value i need to get in
_SelectShipIId


In the top my code is there that is what am tried ..

Please help me to solve this..
Posted
Updated 27-Jul-12 18:25pm
v2
Comments
[no name] 28-Jul-12 0:32am    
Not sure what you are trying to do here. Strings are not decimals. And you are trying to stuff characters into an array of decimals.

1 solution

I think you need to call split by , before you could get a string on the format String[].... Something like:

CDec(_shipID.ToString.Split(",")(i))
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900