TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Send Data Application to Web Service in ASP.NET
Pintoo Yadav
Jun 30
2016
Code
849
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
Application
model.BranchID = Convert.ToInt32(cmbbranch.SelectedValue);
//textbox data pass here
model.Batchno = txtBatch.Text.Trim();
model.ClearingID = Convert.ToString(cmbclearingcode.Text);
ADCTS.WebService.Login LoginServices =
new
WebService.Login();
//Call Web service Here
DataTable dt = LoginServices.Insert_BatchDetails(model.BranchID, model.Batchno, cmbclearingcode.Text, model.ChequeCount,txtPAYEEName.Text.Trim());
//send data here
Web Services
[WebMethod]
public
DataTable Insert_BatchDetails(
int
BranchID,
int
Batchno,
string
cmbclearingcode,
int
ChequeCount,
string
PAYEEName)
//recive data here
{
DataTable ds =
new
DataTable();
filemodel.BranchID = BranchID;
filemodel.Batchno = Batchno;
filemodel.ClearingID = cmbclearingcode;
filemodel.ChequeCount = ChequeCount;
filemodel.payname= PAYEEName;
ds = filecontroller.InsertBatchDetails(filemodel);
// Controller class Here
ds.TableName =
"InsertBatchDT"
;
return
ds;
}
Controller class
public
DataTable InsertBatchDetails(frmFileUploadModel model)
{
dt =
null
;
// ds = null;
DbCommand dbcommand = database.GetStoredPocCommand(
"SP_INSERT_BATCHDETAILS"
);
//sp Call Here
database.AddInParameter(dbcommand,
"@BranchNationID"
, DbType.Int32, model.BranchID);
database.AddInParameter(dbcommand,
"@Batchno"
, DbType.Int32, model.Batchno);
database.AddInParameter(dbcommand,
"@ChequeCount"
, DbType.Int32, model.ChequeCount);
database.AddInParameter(dbcommand,
"@TotalAmount"
, DbType.Double,
database.AddInParameter(dbcommand,
"@PayeeName"
, DbType.String, model.PayeeName);
//ds = database.ExecuteDataSet(dbcommand);
//return ds;
dt = database.ExecuteDataTable(dbcommand);
return
dt;
}
C#
ASP.NET
Web Service