I am creating a web app in which I need to insert into database some values. Here is my webservice for the same:
[WebMethod]
[ScriptMethod(UseHttpGet = true)]
public void saverecd(string id, string particular,string amt,string tdate, string total, string date, string utrno, string modeofpayment, string transferdate,string trainer, string typeofadj)
{
sqlq = "";
sqlq = "insert into finalinstructoreexpense(sonvinid,particulars,amount,totalamt,date,utno,paymentid,paymode,issuedate,sondate,trainer,type,bank_id) values('" + id + "','" + particular + "','" + amt + "','" + total + "',convert(datetime,'" + date + "',105),'" + utrno + "','" + paymentid + "','" + modeofpayment + "',convert(datetime,'" + transferdate + "',105),convert(datetime,'" + tdate + "',105),'" + trainer + "','" + typeofadj + "',null)";
con.Open();
SqlCommand comm1 = new SqlCommand(sqlq, con);
comm1.ExecuteNonQuery();
message = "Adjusted Amount Inserted Successfully";
con.Close();
Context.Response.Write(message);
}
Here I am getting particular as 13111300002,13111300001
, I want to store this values separately in my database:
1531 20667 13111300002,13111300001 200 200 2013-12-15 00:00:00.000 test 1312150001 Online 2013-01-01 00:00:00.000 2013-11-13 00:00:00.000 Ibrahim shaikh split NULL
This is how my data is storing in database:
1531 20667 13111300002 200 200 2013-12-15 00:00:00.000 test 1312150001 Online 2013-01-01 00:00:00.000 2013-11-13 00:00:00.000 Ibrahim shaikh split NULL
1531 20667 13111300001 200 200 2013-12-15 00:00:00.000 test 1312150001 Online 2013-01-01 00:00:00.000 2013-11-13 00:00:00.000 Ibrahim shaikh split NULL
I want to store my data like this.
What I need to do here?
Sorry for bad explanation