This method also use for get User Profile Information such as First Name , Last Name , Office and etc. In generally we can not set a default value to InfoPath Person/Group Picker. On the other hand we can not get Current Username in the InfoPath. (Yeh it is true that we can use userName() function. But this will return the Current User Account ID not the name). So we want to use SharePoint user profile services to do this. First we need to create a user profile connection. Thus First go to Manage connection and click add connection. Then go to receive data option and SOAP Web service and specify the User Profile Service URL . The URL will be something like ( http://sever/sites/site/_vti_bin/UserProfileService.asmx ). This is depends on your site or site collection. if it is a site collection you can omit /sites/site/ part from your URL. then proceed to next , select UserProfileByName and un select the Automatically load. Now you have created the connection....
Comments
I have used code similar to this and I found that it doesn't work if your SQL database uses the "User Instance = true" parameter in the connection string.
What happens is SQL Server 2005 throws an exception with the following message: "Could not locate entry in sysdatabases for database ‘database name'. No entry found with that name. Make sure that the name is entered correctly".
That makes this backup mechanism infeasible for embedded SQL applications that run locally in single-user mode.
I am currently investigating backing up this database to an XML file instead.
Any ideas would be appreciated.