I am trying to create a simple web service which basically takes input parameter A and then according to that parameter it returns result (from query with couple of tables joins) fields from different tables, how to capture that output to use it in rules while binding it with one infopath form field?
My code is below... here am getting them as string but want them as different fields...
public class Data
{
//Create new method to get data from ** database
public static List<string> GetData(string ORDNUM_10)
//public struct GetData(string ORDNUM_10)
{
string PMDES1_01 = "";
string DESCRPTN_104 = "";
string PRTNUM_10 = "";
string ORDREF_10 = "";
string TNXDTE_01 = "";
//Create connection
SqlConnection con = new SqlConnection(@"Data Source=*****;Initial Catalog=EEE;Integrated Security=true;");
//SQL Command
SqlCommand cmd = new SqlCommand("SELECT DISTINCT Account_Types.DESCRPTN_104, Part_Master.PMDES1_01,Order_Master.PRTNUM_10,Order_Master.ORDNUM_10,Order_Master.ORDRef_10,Part_Master.TNXDTE_01 FROM.............. (EUM_10 = '"+ ORDNUM_10 + "'", con);
//Open connection
con.Open();
//to read from SQL Server
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
PMDES1_01 = dr["PMDES1_01"].ToString();
PRTNUM_10 = dr["PRTNUM_10"].ToString();
DESCRPTN_104 = dr["DESCRPTN_104"].ToString();
ORDREF_10 = dr["ORDREF_10"].ToString();
TNXDTE_01 = dr["TNXDTE_01"].ToString();
}
//close connections
dr.Close();
con.Close();
return new List<string> { PMDES1_01, PRTNUM_10, DESCRPTN_104, ORDEF_10 };
}
}
How do I get this string as fields so that I can use them in binding in infopath form field?