Convert DataSet to List

后端 未结 11 2215
一整个雨季
一整个雨季 2020-12-04 08:39

Here is my c# code

Employee objEmp = new Employee();
List empList = new List();
foreach (DataRow dr in ds.Tables[0].Rows)
{
          


        
11条回答
  •  猫巷女王i
    2020-12-04 09:21

     List ListToGetJwToMfData = new List();
                DataSet getJwtMF = new DataSet();
                getJwtMF = objgst_jobwork_to_mfgmaster_BLL.GetDataJobWorkToMfg(AssesseeId, PremiseId,  Fyear,  MonthId, out webex);
                if(getJwtMF.Tables["gst_jobwork_to_mfgmaster"] != null)
                {
    
                    ListToGetJwToMfData = (from master in getJwtMF.Tables["gst_jobwork_to_mfgmaster"].AsEnumerable() select new GSTEntity.gst_jobwork_to_mfgmaster { Partygstin = master.Field("Partygstin"), Partystate =
                                           master.Field("Partystate"), NatureOfTransaction = master.Field("NatureOfTransaction"), ChallanNo = master.Field("ChallanNo"), ChallanDate=master.Field("ChallanDate"),  OtherJW_ChallanNo=master.Field("OtherJW_ChallanNo"),   OtherJW_ChallanDate = master.Field("OtherJW_ChallanDate"),
                        OtherJW_GSTIN=master.Field("OtherJW_GSTIN"),
                        OtherJW_State = master.Field("OtherJW_State"),
                        InvoiceNo = master.Field("InvoiceNo"),
                        InvoiceDate=master.Field("InvoiceDate"),
                        Description =master.Field("Description"),
                        UQC= master.Field("UQC"),
                        qty=master.Field("qty"),
                        TaxValue=master.Field("TaxValue"),
                        Id=master.Field("Id")                        
    
                    }).ToList();
    

提交回复
热议问题