The ViewData item that has the key 'txtCustomer' is of type 'System.String' but must be of type 'IEnumerable'
Here's my Controller:
- wmsSR = new WMSSOFT_WCF_Service.WMSSOFT_InterfaceClient();
- dsl = new DataSet();
- dsO = new DataSet();
- a = "GetSRMCustomers";
- b = string.Empty;
- //b = wmsSR.fCallWMSSOFTService(a, null, ref dsl, ref dsO);
- b = wmsSR.fCallWMSSOFTService(a, "", ref dsl, ref dsO);
- if (b == "OK ~~")
- {
- if (dsO.Tables[0].Rows.Count >= 0)
- {
- List
item = new List (); - for (int i = 0; i < dsO.Tables[0].Rows.Count; i++)
- {
- item.Add(new SelectListItem { Text = dsO.Tables[0].Rows[i]["NAMECUST"].ToString(), Value = dsO.Tables[0].Rows[i]["IDCUST"].ToString().Replace(" ", String.Empty) });
- }
- ViewBag.txtCustomer = item;
- ViewBag.txtCustomer = "ABC ";
- }
- }
Asma KhalidPosted Nov 20, 2017, 12:02 AM
Nilesh PatilPosted Nov 19, 2017, 11:31 PM
Asma KhalidPosted Nov 19, 2017, 11:25 PM
Bryan GomezPosted Nov 19, 2017, 11:23 PM
Nilesh PatilPosted Nov 19, 2017, 11:11 PM