Click here to Skip to main content
14,265,748 members
Rate this:
Please Sign up or sign in to vote.
I need to save those six fields in same column but not in same row and same cell. each field have default i decided to put that default guid's in one list and fields in one list and call that object of that particular list where we want .

ArrayList Alist = new ArrayList();

        ArrayList objValue = new ArrayList();

   var TaxInfoTaxFiledclassobj = new TaxInfoTaxFiled()

            TaxInfoTaxFieldID = TaxInfoTaxFieldObj,
            TaxFieldID = new Guid(Alist .ToString ()),
            FieldValue = objValue.ToString(),

All are working Fine but in TaxFieldID it show the count which has been calculated from list but while saving it shows Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). error? in TaxFieldID what shall i do to resolve this probelm
Updated 12-May-19 5:31am
Richard MacCutchan 12-May-19 11:44am
What is the definition of the TaxFieldID field?
Rate this:
Please Sign up or sign in to vote.

Solution 1

You are trying to convert the ArrayList to Guid.
TaxFieldID = new Guid(Alist .ToString ())

Use an iterator (for / while / foreach) to iterate through the ArrayList items and convert each item.
Member 12087373 8-Jan-16 2:49am
I tried that also but i got object reference error it cannot get the object from viewmodel to controller
Rate this:
Please Sign up or sign in to vote.

Solution 2

On the first look, below line may throw an error:
TaxFieldID = new Guid(Alist .ToString ()),

Guid constructor does not accept array of strings, it accepts single string.
Guid g = new Guid(Alist[0]);

See: Guid Constructor (System)[^]
Member 12087373 8-Jan-16 2:42am
I need to save those six fields i that fields
Maciej Los 8-Jan-16 2:44am
I need to see TaxInfoTaxFiled definition.
Member 12087373 8-Jan-16 2:48am
yes sure It is a TaxInfoTaxfield Table . In that table i have 2 fields TaxFieldID and FieldValue . I need to save those six guid's in taxfieldID and ^ field values in Fieldvalue column
Maciej Los 8-Jan-16 2:55am
None of above information is useful.
Member 12087373 8-Jan-16 3:00am
hey i said my issue in one document clearly . shall i send that you
Maciej Los 8-Jan-16 3:09am
Sorry, but if you want our help, you have to put all required information via QA forum.
Improve question and post TaxInfoTaxfield definition.

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100