title: How to accept parameters (including images) through a json web service and store it into a SQL Server database?
body: <p>I am getting an error:</p>
  
  <blockquote>
    <p>Operation 'addUser' in contract 'IService1' has a UriTemplate that expects a parameter named 'PHONE_NO,DP,REG_ID', but there is no input parameter with that name on the operation.</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>public interface IService1
  {
      [OperationContract]
      void DoWork();
  
      [OperationContract]
      [WebInvoke(Method = "POST", 
                 ResponseFormat = WebMessageFormat.Json, 
                 BodyStyle = WebMessageBodyStyle.Wrapped, 
                 UriTemplate = "addUser/{phone_no,dp,reg_id}")]
      void addUser(String phone_no, String dp, String reg_id);
  }
  </code></pre>
  
  <p>and the <code>addUser</code> function is as follows:</p>
  
  <pre><code> public void addUser(String phone_no, String dp, String reg_id)
   {
          string conn = "";
          conn = ConfigurationManager.ConnectionStrings["Conn"].ToString();
  
          SqlConnection objsqlconn = new SqlConnection(conn);
          objsqlconn.Open();
  
          SqlDataAdapter da = new SqlDataAdapter();
  
          SqlCommand cmd = new SqlCommand("select * from dbo.User where phone_no in (" + phone_no + ")", objsqlconn);
          da.SelectCommand = cmd;
          DataSet ds = new DataSet();
  
          da.Fill(ds);
          objsqlconn.Close();
  
          if (ds.Tables[0].Rows.Count == 0)
          {
              objsqlconn.Open();
  
              SqlCommand cmd2 = new SqlCommand("insert into dbo.User(phone_no,dp,reg_id) values(@phone_no,@dp,@reg_id)", objsqlconn);
              da.SelectCommand = cmd2;
              DataSet dt = new DataSet();
              da.Fill(ds);
              objsqlconn.Close();
          }
     }
  </code></pre>
  
  <p>Here <code>dp</code> is the image can someone tell me if this is the right way to accept images?</p>