[WebMethod]
public FactureTopNet CreationFacture( ref int NUM_FACTURE, ref int NUM_JUR_FACT,ref int SOCIETE, ref int TYPE, ref string LOGIN_CREATION,ref DateTime DATE_CREATION, ref string LOGIN_MODIFICATION,ref DateTime DATE_MODIFICATION,ref Decimal MNT_FACT,ref decimal REMISE, ref decimal NET_PAYE,ref decimal REST_PAYE,ref string OBSERV, ref int ID_CLIENT,ref string REMARQUE,ref string MONTANTTEXT, ref int TIMBRE, ref int AVOIR, ref int NUM_LISTE,ref int ID_REV,ref int NUM_PF, ref int NUM_PP, ref string REFERENCE, ref string CLE, ref int ID_COM,ref decimal MONTANT_COM, ref DateTime DATE_COM,ref int RED_COM, ref int INTER_GROUPE)
{
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection();
conn.ConnectionString = @"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=topnet;Initial Catalog=TopnetBase;Data Source=SWEET-4B6F892B4\SQLEXPRESS";
conn.Open();
FactureTopNet facture = new FactureTopNet();
int r;
string req = "INSERT INTO facture (NUM_FACTURE, NUM_JUR_FACT, SOCIETE, TYPE, LOGIN_CREATION, DATE_CREATION,LOGIN_MODIFICATION,DATE_MODIFICATION,MNT_FACT, REMISE, NET_PAYE, REST_PAYE, OBSERV, ID_CLIENT, REMARQUE, MONTANTTEXT, TIMBRE, AVOIR,NUM_LISTE,ID_REV,NUM_PF,NUM_PP, REFERENCE, CLE, ID_COM,MONTANT_COM, DATE_COM, RED_COM, INTER_GROUPE)VALUES('" + NUM_FACTURE + "','" + NUM_JUR_FACT + "','" + SOCIETE + "','" + TYPE + "','" + LOGIN_CREATION + "','" +DATE_CREATION + "','" + LOGIN_MODIFICATION + "','" + DATE_MODIFICATION + "','" + MNT_FACT + "','" + REMISE + "','" + NET_PAYE + "','" + REST_PAYE + "','" + OBSERV + "','" + ID_CLIENT + "','" + REMARQUE + "','" + MONTANTTEXT + "','" + TIMBRE + "','" + AVOIR + "','" + NUM_LISTE + "','" + ID_REV + "','" + NUM_PF + "','" + NUM_PP + "','" + REFERENCE + "','" + CLE + "','" + ID_COM + "','" +MONTANT_COM + "','" + DATE_COM + "','" + RED_COM + "','" + INTER_GROUPE + "')";
System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand(req, conn);
r = command.ExecuteNonQuery();
facture.NUM_FACTURE = NUM_FACTURE;
facture.NUM_JUR_FACT = NUM_JUR_FACT;
facture.SOCIETE = SOCIETE;
facture.TYPE = TYPE;
facture.LOGIN_CREATION = LOGIN_CREATION;
facture.DATE_CREATION = DATE_CREATION;
facture.LOGIN_MODIFICATION = LOGIN_MODIFICATION;
facture.DATE_MODIFICATION = DATE_MODIFICATION;
facture.MNT_FACT = MNT_FACT;
facture.REMISE = REMISE;
facture.NET_PAYE = NET_PAYE;
facture.REST_PAYE = REST_PAYE;
facture.OBSERV = OBSERV;
facture.ID_CLIENT = ID_CLIENT;
facture.REMARQUE = REMARQUE;
facture.MONTANTTEXT = MONTANTTEXT;
facture.TIMBRE = TIMBRE;
facture.AVOIR = AVOIR;
facture.NUM_LISTE = NUM_LISTE;
facture.ID_REV = ID_CLIENT;
facture.NUM_PF = NUM_PF;
facture.NUM_PP = NUM_PP;
facture.REFERENCE = REFERENCE;
facture.CLE = CLE;
facture.ID_COM = ID_COM;
facture.MONTANT_COM = MONTANT_COM;
facture.DATE_COM = DATE_COM;
facture.RED_COM = RED_COM;
facture.INTER_GROUPE = INTER_GROUPE;
return facture;
}
|
Kapil Deo MalhotraPosted Jun 7, 2010, 3:22 PM
Are you invoking the Web methond using the browser or from any client which consume the web service? If you are doing from the Studio then most probably there is some data type which is not primitive and you will not able to do that.
You can call the web service from the client and pass the value. As suggested by Daniel you can try removing ref keyword.
Daniel VarghesePosted Jun 7, 2010, 2:42 PM
Are you facing this error while invoking a web service method from an asp.net page or while directly accessing the web service through the browser. Try removing the ref keywords from the parameters and check again.
Thanks,
Daniel