webservice and repeating table - InfoPath Dev
in

InfoPath Dev

webservice and repeating table

Last post 04-17-2008 08:47 AM by buddyguy. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 04-17-2008 08:47 AM

    webservice and repeating table

    Hey Everyone

    I have a webservice and my code is attached below.  this webservice takes repeating table data and puts it to a sql table.  the issue is the webservice only submits the first line of the repeating table.  can anyone tell me whats wrong? 

     Thanks in advance.

    Arley

    [WebMethod]

    public int Insert2(

    string empname,

    string FormNumber,

    string itemid,

    string expensedate,

    string origaddress,

    string origmunicipality,

    string desaddress,

    string desmunicipality,

    string purpose,

    int km,

    string nonmileageexp,

    float expenseamt,

    float ExpRate,

    string CompDate,

    string ApprDate,

    string AppSup)

    {

    const string INSERT_COMMAND =

    "insert into tblfromeforms(" +

    "empname,FormNumber,itemid,expensedate,origaddress," +

    "origmunicipality,desaddress," +

    "desmunicipality,purpose,km,nonmileageexp,expenseamt,ExpRate,CompDate,ApprDate,AppSup)" +

    "values (@empname,@FormNumber,@itemid,@expensedate,@origaddress," +

    "@origmunicipality,@desaddress," +"@desmunicipality,@purpose,@km,@nonmileageexp,@expenseamt,@ExpRate,@CompDate,@ApprDate,@AppSup)";

     

    string strConn =

    System.Configuration.ConfigurationManager.ConnectionStrings["SQLTEMP_CONNECTION"].

    ConnectionString;

    try

    {

    using (SqlConnection cnn = new SqlConnection(strConn))

    {

    cnn.Open();

     

     

    using (SqlCommand cmd = new SqlCommand())

    {

    cmd.Connection = cnn;

    cmd.CommandText = INSERT_COMMAND;

    SqlParameterCollection ps = cmd.Parameters;

    ps.AddWithValue("@empname", empname);

    ps.AddWithValue("@FormNumber", FormNumber);

    ps.AddWithValue("@itemid", itemid);

    ps.AddWithValue("@expensedate", expensedate);

    ps.AddWithValue("@origaddress", origaddress);

    ps.AddWithValue("@origmunicipality", origmunicipality);

    ps.AddWithValue("@desaddress", desaddress);

    ps.AddWithValue("@desmunicipality", desmunicipality);

    ps.AddWithValue("@purpose", purpose);

    ps.AddWithValue("@km", km);

    ps.AddWithValue("@nonmileageexp", nonmileageexp);

    ps.AddWithValue("@expenseamt", expenseamt);

    ps.AddWithValue("@ExpRate", ExpRate);

    ps.AddWithValue("@compdate", CompDate);

    ps.AddWithValue("@apprdate", ApprDate);ps.AddWithValue("@appsup", AppSup);

     

    return cmd.ExecuteNonQuery();

    }

    }

    }

    catch (Exception ex)

    {

    System.Diagnostics.Trace.WriteLine(ex.ToString()); // Say _something_

    throw;

    }

    }

    }

     

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.