Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Biztalk 2004: How to pass database facts from C# code?

Biztalk 2004: How to pass database facts from C# code?

Scheduled Pinned Locked Moved C#
csharpdatabasedata-structurestoolsxml
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pankazmittal
    wrote on last edited by
    #1

    Hi Tools: C#, .NET 1.1 and Biztalk 2004 I want to execute a policy rule which gets fired based on some input xml and database facts. I am able to pass the input xml facts but how to I pass the database facts information before executing policy. Basically, by passing "Role" information, I want to get "Salary" values which are stored in a database table. Following is the code snippet: -------------------------------------------------------------- Input XML: Manager CIO -------------------------------------------------------------- ---------------------------- public string Execute(string sRequestXML, out string sResponseXML, out string sErrorMsg) { sResponseXML = string.Empty; sErrorMsg = string.Empty; DebugTrackingInterceptor dti = new DebugTrackingInterceptor(@"C:\Biztalk\projects\EmployeeInfo\XSDs\jit.txt"); //create an instance of the XML object XmlDocument xd1 = new XmlDocument(); xd1.Load(@"C:\Biztalk\projects\EmployeeInfo\XSDs\Copy of EmpInfo_output.xml"); TypedXmlDocument doc1 = new TypedXmlDocument("EmpInfo",xd1); // create the array of short-term facts object[] shortTermFacts = new object[1]; shortTermFacts[0] = doc1; Policy policy = null; // now execute to see what happens try { //Console.WriteLine("Grabbing the policy ..."); policy = new Policy("EmpInfo"); policy.Execute(shortTermFacts, dti); FileInfo finfo = new FileInfo(@"C:\Biztalk\projects\EmployeeInfo\XSDs\ProcessedRFP.xml"); StreamWriter writer = finfo.CreateText(); writer.Write(doc1.Document.OuterXml); writer.Close(); } catch (Exception ex) { FileInfo finfoError = new FileInfo(@"C:\Biztalk\projects\EmployeeInfo\XSDs\Error.xml"); StreamWriter writerError = finfoError.CreateText(); writerError.Write(ex.Message); writerError.Close(); } dti.CloseTraceFile (); policy = null; return "PASS"; }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups