.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to Read values from the XAML file at Runtime

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :Windows Application
Hi , I am creating a BuildDefinition from code and Loading the Build Process template. Now,I want to read and Validate the Build Process template parameter values.When I am debuggig,I could see that these are in Xaml format. Ex: I have some value "BuildType" as "Daily" in xaml file.I want to read these values and validate them I dont know what is the bestway to read the values.Can any one please let me know how can we do it. Thanks, Srikrishna              

View Complete Post

More Related Resource Links

How to read control id and values from pdf file



 I have requirement like admin will uploads some pdf files ,which contain text box ,check box ...,

similarly we will have master table which contain some matched fields.

If pdf fields mached with master table fields then i will store mached fields pdf control id's in data base , next time if i open this pdf file i need to auto fill this matched fields in pdf file.

Can any one gudie me right direction please.

Using the Client Object Model to read values from Excel file produces 504 error



I use the Client Object Model to retrieve and read values from an Excel file. This is triggered in an Event Receiver on the Document Library where the Excel file lives. I use a simple CAML Query to retrieve the file. This has worked just fine on a dev/test server. 
Now, I just recently deployed this solution to a production/live server and now this code doesn't work anymore. I get an error saying 'The remote server returned an error: (504) Gateway Timeout'. This happnes when I try clientContext.ExecuteQuery();

The difference between the two servers is that on the test server (where it works) the solution is sitting as the root site, so to speak. No host headers or nothing.
On the live server, there are several web applications (SharePoint) on the same port, but with different host headers.

I have tried to trace a little bit and I found that on the test server, the url that is used to create the ClientContext object is 'http://<servername>/<webname>'. The url is comes from the following code: web.Url. I tried changing the url to the DNS name the test server has and that resulted in the same error as on the live server.

Does anyone have any idea what I need to do?

Thanks a billion!

I am not able to read xml file with XDocument if its Descendants has Attribute xmlns="http://abc.co


I am not able to read xml file with XDocument if its Descendants has  Attribute like:-

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <row ID="1" xmlns="http://www.opentravela.org/OTA/2003/05">
    <var country_name="Caribbean and Rest of the world" city_name="Kingston" flight_category="Economy Class" via="Atlanta" flight_departure="London Heathrow" airline_logo="Delta" adult_fare="Delta" child_fare="660" infant_fare="561" date1="132" date2="2010-08-15" />


I don't know what to do ?

Looking for some help..

Read Excel file from Web Application (C#)



I have a web app where user uploads a file.

File is saved in server locally and I want to read some data from it.

Currently my development  server has office 2003.

So do I need office 2007 in order to be able to  read an excel from office 2007 ?

What are other requirements  ?

I tried a test, using

Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook wrkBook; // = new Microsoft.Office.Interop.Excel.Workbook();

wrkBook = excelApp.Workbooks.Open(@"C:\www\excel_files\b.xls", ....);

But When trying to open the file I get the error:

Exception from HRESULT: 0x800A03EC

So I'm wondering what I'm missing.


Moved from WinXP to Win7 - don't see choice to open file in read only or edit mode


I just recently moved from Win XP Pro SP3 to Win 7 32-bit Pro. I am logging into domain X normally. Our Sharepoint 2007 server authenticates only on domain Y. So I start Internet Explorer with "run as different user" and provide my domain Y credentials. All fine. 

In win XP, after I did this, when I click on an Excel file on Sharepoint, I would get a dialog asking if I wanted to check out and edit or open as read only. 

In win7, I don't get that choice. The file simply opens, and I get a bar at the top which allows me to check out the file if I wanted to. 

How can I restore the functionality I used to have, with the dialog for checking out the file before opening it?

How to load a usercontrol xaml at runtime ???????

Hi, I have a usercontrol xaml created in Expression Blend. Similarly i have xaml for other usercontrols as well. Now i want to draw these controls at runtime on click of buttons, the way it works in VS IDE (Toolbox and Drawing area) Is there any way to load such usercontrols on Canvas at runtime ? What would be the best way to load controls at runtime ?      Programmer

Read an XML file, setting uname/pw, Accept, Content-Type

Hi; To read some REST XML data we need to set the username, password, and tell it for the http request Accept: application/xml Content-Type: application/xml Is there a sample anywhere showing how to do this? thanks - daveVery funny video - Reporting as a Metaphor

How to add 3D object from xaml file to my viewport3D?

I have viewport3D and I want to add multiple 3d objects defined in xaml files to this Viewport3D, but by default 3d object deffined in .xaml file comes already with viewport3D and I can not add it to my Viewport3D How I can use those 3D objects from .xaml files in my Viewport3D? I tryed to read xaml with XamlReader cast it to viewport3D and then take vieport3D child elements and add to my viewport, but I get error "Specified Visual is already a child of another Visual or the root of a CompositionTarget." 

Read a text file on another server from a web page

How do I read/write a text file on another server from a web page. I get the error "Access to the path '//Server2/mydatafiles/test.txt' is denied". I do not get the error if I am running the browser on the server where the files exist. I think I need to set permissions on the destination server in some way.   Can you help? Thanks  

Not able to read Config File data in Windows Service

While I'm trying to read connection string which is in App.Config file I'm getting error like "Object reference not set to an instance of an object." string strconn = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"].ToString(); For the windows service where I need to keep app.config file and how to integrate that config file with the windows service exe file. Thanks in advance.

e.PageSettings values take too long to read.

I have an application that takes a long time to view the Print Preview on a particular user's computer.  The rest of my users don't have a problem.  I narrowed the problem down to the following line of code: Dim XOffset As Single = CSng((e.PageSettings.PaperSize.Width - e.PageSettings.Margins.Right - e.PageSettings.Margins.Left) / 2 - StringSize.Width / 2) which simply determines an X offset for a subsequent e.Drawstring that is centered. On this particular user's computer, this line of code takes between 1 and 2 seconds to execute. Another strange symptom is that once he prints the document, the print preview executes as fast as it should. Can anyone shed some light on this mysterious behavior?  Thanks!

Cannot read stream from uploaded file

I have a file upload which uploads a file and gets read into a byte array.int FileLength = File1.PostedFile.ContentLength; if (File1.PostedFile != null && File1.HasFile) { Stream fStream = File1.PostedFile.InputStream; byte[] contents = new byte[fStream.Length]; fStream.Read(contents, 0, (int)fStream.Length); fStream.Close(); fStream.Dispose(); The problem is, the fStream.Read seems to have a problem reading the stream. When I debug it, and the value of "contents" appears to be empty. The file gets uploaded as a corrupted file.  

Hosted Designer fails to load workflow xaml that has InArguments with default values (xaml saved by

I have hosted the designer in our app. Using the hosted designer, workflows are saved as xaml to a database. When an end user wishes to edit a workflow the xaml is downloaded to a file and loaded into the designer via the .xaml file. The user can also associate assemblies with the workflow and there is a mechanism which makes sure that these assemblies are loaded into the appdomain and available. The problem we are hitting occurs when the top level activity (Sequence) has InArgument with default value. I create a simple Sequence, add InArguments (type of Int32 and String)  and set some default values. I save the workflow xaml to the database and close down the designer. When I wish to edit the workflow and try to load I get the following errors Could not find member '{clr-namespace:}_e905.argument3'. Could not find member '{clr-namespace:}_e905.argument1'. suggesting that some assembly/namespace missing. Here is the xaml I try to load: <Activity mc:Ignorable="sap" x:Class="{x:Null}" this:_e905.argument3="99" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorl

How to read a file without "disturbing" file updater

Hi, I have written a small tool that responds to that logfiles are updated. I use:   FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) Which - according to my knowledge - is the way to read a file without disturbing other users of the file. But when I run this program, writers to this file may fial and I need to avoid this by all means. Do you know, what I am doing wrong? It should be said, that I use FileSystemWatcher in order to detect if the file is updateed or not. Can that be the reason? TIA Best regards Soeren D.

find and replace linebreaks in file read from disk

I have a css file which I want to read from disk and in that content I want to find and replace all linebreaks (do I look for vbCrlf or ...?)   Public Shared Function GetFileContents(ByVal FullFilename As String) As String        Dim filecontents As String = ""        If File.Exists(FullFilename) Then            Dim objStreamReader As StreamReader            objStreamReader = File.OpenText(FullFilename)            filecontents = objStreamReader.ReadToEnd()            objStreamReader.Close()        End If       Return filecontents    End FunctionSo in the returned variable "filecontents" I want to find and replace any linebreaks.        FILE: style.css#progress{color:#000;width:500px;height:30px;padding:0px;clear:both;}#progress ul{list-style:none;padding:0px;margin: auto;display:block;}#progress ul li{list-style:none;display:inline;float:left;width:auto;height:30px;padding:0px;line-height:30px; font-family:Arial, Helvetica, sans-serif; font-size:13px;}

Read Binary Data which is nothing but a Zip file and unzip through SSIS 2005 SP2

Hi ALL, I need some help in developing a task. I have a source database which is Oracle and it has a ZIP file stored inside the database in Binary format. When I move this data into the sql server 2005 database I get the data as binary data. Now the task begins with SSIS, I need to read the binary data which gives us a zip file and then unzip this zip file and read the XML data which is present inside the Zip file. I beleive some one might have already developed this task can you share the solution with us. Note: As this has to be moved into production I dont have permission to use third party tools like Cozy roc or install winrar.exe and simpy calling this exe from the execute process task in SSIS.  Raju

Build xml file from gridview values on button click

We are looking to add GoogleMaps to our application. With that said we are going to be using the geocoding api to pass in the lat and long values to pin point locations on the the map. Reading thru the documentation we can pass in the values via XML, so we would like to see how we can take the lat and long values from our gridview and pass that to the API if and when somone clicks on the button to show the map.. The process will work like so, you arrive at the search page, you complete a search, in most if not all cases, you will always get multiple results presented in a gridview. If you should to view them all on the map, you click button and it needs to map out each location on the map. So is there anyway to pull from the gridview the lat, long and description to pass into the API?   Any links to sites that i can review would be great. thanks. 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend