Sandip Paul

Sandip Paul

  • 1.2k
  • 583
  • 2.4k

How to send sqlite data to asmx web service

Jan 28 2015 3:37 AM
This is my web service method for inserting data into table

 [WebMethod]
 public void insertidentry(int wcode, int mcode, int ccode, int dr, int evcode, string loccode, string lotcode,string houseno,string houseadd,string postion,string latitude,string longitude,string altitude,string accuracy,string phoneno,string hhfname,string hhlname,string hhmname,string ivcode,string ivdate,string sttime,string endtime,int hhno,int code,string edate,string hhid)
    {
        string conStr = WebConfigurationManager.ConnectionStrings["SQLDbConnection"].ConnectionString;
      
        using (SqlConnection conn = new SqlConnection(conStr))
        {
            string sql = string.Format(@"Insert into    IdMaster(WCode,MCode,CCode,DR,EVCode,LocCode,LotCode,HouseNo,HouseAdd,Postioning,Latitude,Longitude,Altitude,Accuracy,
PhoneNo,HHFname,HHLname,HHMname,IVCode,IVdate,StTime,EndTime,HHNo,ICode,Edate,HHID) values (" + wcode +"," + mcode  + "," + ccode  + "," + dr + "," + evcode + ",'" + loccode + "','"+ lotcode + "','" + houseno + "','" + houseadd + "','" + postion + "','" + latitude + "','" + longitude + "','" + altitude + "','" + accuracy + "','" + phoneno    + "','" + hhfname + "','" + hhlname + "','" + hhmname  + "','" + ivcode + "','" + ivdate + "','" + sttime + "','" + endtime + "'," + hhno + "," + code + " ,'" + edate  + "','" + hhid + "') ");
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = conn;
            cmd.CommandText = sql;
            cmd.CommandType = CommandType.Text;
            conn.Open();
            cmd.ExecuteNonQuery();
            conn.Close();
            cmd = null;
        }
    }


I want to send all my sqlite data to ms sql server.