タイプ 'ServiceReference1.EmployeeModel' のオブジェクトをタイプ 'System.IConvertible' にキャストできません。上記のエラーとは正確には何ですか?それを回避するには、何をしなければなりませんか?
protected void btnCreate_Click(object sender, EventArgs e)
{
JavaScriptSerializer jsn = new JavaScriptSerializer();
WebRequest request = WebRequest.Create("localhost:50506/Service1.svc/CreateEmployee";);
request.Method = "POST";
request.ContentLength = 10;
EmployeeModel emp = new EmployeeModel(); //i added emp fields in to emp
Byte[] data = { Convert.ToByte(emp) };
Stream requestStream = request.GetRequestStream();
requestStream.Write(data, 0, data.Length); //in Byte[] data line the error is coming
}