How can I load an XAML file into a FlowDocumentReader?

This example demonstrates how to parse an XAML file that contains a FlowDocument and display the loaded file in a FlowDocumentReader. [XAML] <FlowDocumentReader Name='flowDocRdr' IsFindEnabled='True' IsPrintEnabled='True' MinZoom='50' MaxZoom='1000' Zoom='120' ZoomIncrement='5' /> And write the following FlowDocument to the file stream : [C#] void LoadFlowDocumentReaderWithXAMLFile(string fileName) { // Open the file that contains the FlowDocument... FileStream xamlFile = new FileStream(fileName, FileMode.Open, FileAccess.Read); // and parse the file with the XamlReader.Load method. FlowDocument content = XamlReader.Load(xamlFile) as FlowDocument; // Finally, set the Document property to the FlowDocument object that was // parsed from the input file. flowDocRdr.Document = content; xamlFile.Close(); }

Why do I get the error message ‘Sql Server does not exists or access denied ‘ whenever I try to access the data on Sql server

The ASP.NET worker process doesn’t have the correct permissions to connect to or write to the SQL Server database. Either enable impersonation for users, or configure the ASP.NET worker process to run under the SYSTEM account. The ASPNET account cannot establish a named pipes connection to the database server. Try using TCP/IP instead of the Named Pipes protocol to connect to the database by adding ‘Network Library =dbmssocn’ in your connection string For more information refer BUG: Named pipes do not work when worker process runs under ASPNET account Process and request identity in ASP.NET

Is there a method similar to Response.Redirect that will send variables to the destination page other than using a query string or the post method

Server.Transfer preserves the current page context, so that in the target page you can extract values and such. However, it can have side effects; because Server.Transfer doesnt’ go through the browser, the browser doesn’t update its history and if the user clicks Back, they go to the page previous to the source page. Another way to pass values is to use something like a LinkButton. It posts back to the source page, where you can get the values you need, put them in Session, and then use Response.Redirect to transfer to the target page. (This does bounce off the browser.) In the target page you can read the Session values as required. Refer to Passing Values Between Web Forms Pages for more information.