reg:secoundary data source,pls help me it's urgt - InfoPath Dev
in

InfoPath Dev

reg:secoundary data source,pls help me it's urgt

Last post 10-04-2007 07:25 AM by adamrharding. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-13-2007 02:23 AM

    reg:secoundary data source,pls help me it's urgt

    Hi Friends,

    My question is i am having a browser based infopath, when form is opend i am successfull capturing user authontication id, how ever i have to pass this username to my webservice

     

    using System;
    using System.Web;
    using System.Web.Services;
    using System.Web.Services.Protocols;
    using System.Data;
    using System.Data.SqlClient;

    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

    public class Service : System.Web.Services.WebService
    {
            public struct Employee
            {

                public String Name;
                public String EmailID;
                public String LineMgr_EmailID;
                public String SecApprover_ID;
                public String HR_EmailID;
                public String HRCC_ID;
                public String Div_ID;
                public String DepartementName;

            }


            SqlConnection sqlcEmployee = new SqlConnection();
            SqlCommand sqldEmployee = new SqlCommand();

          
            [WebMethod]
            public string HelloWorld()
            {
                return "Hello World";
            }

     

     

    [WebMethod]
            public Employee GetEmployeeInformation(string UserName)
            {
                Employee ObjEmployee = new Employee();
                sqlcEmployee.ConnectionString = "initial catalog=LMS;user id=ias;password=ias;server=gdc-sql2000";
                if (sqlcEmployee.State == ConnectionState.Closed)
                {
                    sqlcEmployee.Open();
                }
                sqldEmployee.CommandText = "LMS_FillLeaveForm_Test";
                sqldEmployee.Connection = sqlcEmployee;
                sqldEmployee.CommandType = CommandType.StoredProcedure;
                SqlParameter sqlpUserName = new SqlParameter("@uname", SqlDbType.VarChar);
                sqlpUserName.Value = UserName;
                sqldEmployee.Parameters.Add(sqlpUserName);
                SqlDataReader dr;
                dr = sqldEmployee.ExecuteReader();
                while (dr.Read())
                {
                    ObjEmployee.Name = Convert.ToString(dr["NAME"]);
                    ObjEmployee.EmailID = Convert.ToString(dr["emailID"]);
                    ObjEmployee.LineMgr_EmailID = Convert.ToString(dr["LineMgr_EmailID"]);
                    ObjEmployee.SecApprover_ID = Convert.ToString(dr["SecApprover_ID"]);
                    ObjEmployee.HR_EmailID = Convert.ToString(dr["HR_EmailID"]);
                    ObjEmployee.HRCC_ID = Convert.ToString(dr["HRCC_ID"]);
                    ObjEmployee.Div_ID = Convert.ToString(dr["Div_ID"]);
                    ObjEmployee.DepartementName = Convert.ToString(dr["dept_name"]);

                }

                return ObjEmployee;
            }

        }

    and i am retriving all the user information from the database to webserver, up to this things are working fine. my doubt is how to connect this infopath to webserver and get the data at in load() event(using secoundary data sorce ) of infopath.could any one send me the code or a good artical regarding this.

     

    please help me frds,

     

    waiting for your kind response,

    Thanks & regards

    Sithender.S

     

  • 10-04-2007 07:25 AM In reply to

    Re: reg:secoundary data source,pls help me it's urgt

    Hi

    OK if i have made sense of this you have uploaded a load of data onto a web server and want to share it on_load with Infopath?

    If this is the case you need to write a web service to present the data then you can give Infopath the web service address to add as a secondary data source, job done.

    I hope this helps

    Adam

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