Send Data Application to Web Service in ASP.NET

Application

  1. model.BranchID = Convert.ToInt32(cmbbranch.SelectedValue);//textbox data pass here   
  2. model.Batchno = txtBatch.Text.Trim();   
  3. model.ClearingID = Convert.ToString(cmbclearingcode.Text);   
  4.   
  5. ADCTS.WebService.Login LoginServices = new WebService.Login(); //Call Web service Here   
  6.   
  7. DataTable dt = LoginServices.Insert_BatchDetails(model.BranchID, model.Batchno, cmbclearingcode.Text, model.ChequeCount,txtPAYEEName.Text.Trim());//send data here   
Web Services
  1. [WebMethod]    
  2. public DataTable Insert_BatchDetails(int BranchID, int Batchno, string cmbclearingcode, int ChequeCount, string PAYEEName)//recive data here     
  3.                 
  4.   
  5. {    
  6.     DataTable ds = new DataTable();    
  7.     filemodel.BranchID = BranchID;    
  8.     filemodel.Batchno = Batchno;    
  9.     filemodel.ClearingID = cmbclearingcode;    
  10.     filemodel.ChequeCount = ChequeCount;    
  11.        filemodel.payname= PAYEEName;          
  12.   
  13.   
  14.     ds = filecontroller.InsertBatchDetails(filemodel);// Controller class Here    
  15.   
  16.   
  17.     ds.TableName = "InsertBatchDT";    
  18.     return ds;    
  19. }    
Controller class
  1. public DataTable InsertBatchDetails(frmFileUploadModel model)    
  2. {    
  3.     dt = null;    
  4.    // ds = null;    
  5.     DbCommand dbcommand = database.GetStoredPocCommand("SP_INSERT_BATCHDETAILS");//sp Call Here    
  6.     database.AddInParameter(dbcommand, "@BranchNationID", DbType.Int32, model.BranchID);    
  7.     database.AddInParameter(dbcommand, "@Batchno", DbType.Int32, model.Batchno);    
  8.                 database.AddInParameter(dbcommand, "@ChequeCount", DbType.Int32, model.ChequeCount);    
  9.     database.AddInParameter(dbcommand, "@TotalAmount", DbType.Double,     
  10.     database.AddInParameter(dbcommand, "@PayeeName", DbType.String, model.PayeeName);    
  11.   
  12.     //ds = database.ExecuteDataSet(dbcommand);    
  13.     //return ds;    
  14.   
  15.     dt = database.ExecuteDataTable(dbcommand);    
  16.   
  17.     return dt;    
  18. }