Write Request to SQL Table
I am developing a new Custom WorkFlow Activity. In this i need to add a data like Request ID into a table. 1.Can any one tell how to connect to a SQL Server and where to put the connection strings i.e which config file..2. If any sampl code or related links you have then plz share it
January 27th, 2010 1:10pm
Hi Vinod,To connect to a SQL Server database in a custom workflow activity, simply add the LINQ to SQL Classes to your VS project (as you would with any other .NET project). Then, you'll add any config settings (like connection strings) to the FIM web service config file:C:\Program Files\Microsoft Forefront Identity Manager\2010\Service\Microsoft.ResourceManagement.Service.exe.config(or similar)Hope this helps,Joe
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2010 2:48am
Thanks Joe....Can we use the connection string with the help of ado.net or we need to specifically use the linq for that...
January 28th, 2010 9:51am
Yes, of course, ADO.NET will also work.
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2010 7:34pm
Thanks Joe for ur guidance...We have added a connection string in Microsoft.ResourceManagement.Service.exe.config
<
appSettings><add key="sqlConnection" value="Data Source=xxxxx;Initial Catalog=xxxx;Integrated Security=SSPI;"/></appSettings>In work activity we are tryed to call the connection string ...
string strSqlConnection = ConfigurationManager.AppSettings["sqlConnection"].ToString();
using (SqlConnection connection = new SqlConnection(strSqlConnection)){connection.Open();// Do work here; connection closed on following line.} But we are geeting object refrence error... Can you please guide us how we read the connect string from the Microsoft.ResourceManagement.Service.exe.config file....
January 29th, 2010 10:35am