I'm creating a wcf service to add and delete employees... I'm using stored procedures to do so.. i'm not supposed to use any frameworks... I need to give the input through winforms, Can anyone tell me how to connect winform to wcf service?
P.S: I cannot have direct contact with Data Base, Everyrthing must be through WCF Service only.
Thanx in advance :)
tc...

Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jun 19, 2013, 8:21 PM EDT
http://chandradev819.wordpress.com/2011/01/27/how-to-create-crud-operation-in-asp-net-using-wcf/
Vikram N65 reputationPosted Jun 19, 2013, 9:20 PM EDT
But in dat example, database tables are used... But i need stored procedures usage... kindly help:)
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jun 19, 2013, 10:36 PM EDT
public int SaveEmp(Emp objEmp)
{
using (SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True"))
{
string query = "Emplyentry"; //stored procedure name
using (SqlCommand cmd = new SqlCommand(query , con))
{
cmd.Parameters.AddWithValue("@EmpName", objEmp.EmpName);
cmd.Parameters.AddWithValue("@EmpSal", objEmp.EmpSal);
con.Open();
int a = cmd.ExecuteNonQuery();
con.Close();
return a;
}
}
}
Vikram N65 reputationPosted Jun 20, 2013, 8:30 PM EDT