.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

XML binding and notification on change

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :WPF
Dear all, I have a customer project when I need to display data into a WPF application. Data are deliver by my customer as flat XML file struture. For exemple: Information relative to a GOOD will be store in a GOOD.XML file Information relative to a CONTACT will be store in a CONTACT.XML file and exmaple of this structure is as follow : <GOODS> <GOOD> <CATEGORIE>APPARTEMENT</CATEGORIE> <NB_PIECES>3</NB_PIECES> <NB_CHAMBRES>2</NB_CHAMBRES> <SURF_HAB>60</SURF_HAB> <SURF_CARREZ>60,6</SURF_CARREZ> <SURF_SEJOUR>21</SURF_SEJOUR> <SURF_TERRAIN>0</SURF_TERRAIN> <ETAGE>0</ETAGE> <CODE_ETAGE>RJ</CODE_ETAGE> <NB_ETAGES>4</NB_ETAGES> <ANNEE_CONS>1996</ANNEE_CONS> <CUISINE>AMERICAINE</CUISINE> </GOOD> </GOODs> So the file avove will be sen from my customer app on a network drive. then I will read that file and bind my applicaction against. If my customer provide a file update, he will drop the new file at same network location and my application should read new data . The number of file extracted will be around 40 . Each file represent a separate object My questions are : 1- At first I was planning to build a local database as SQL express based on those file and work on the db but now I wonder if I should go to that

View Complete Post

More Related Resource Links

ASP.Net - App Pool restarts because of file change notification

Hi All,IIS restarts everytime i delete a file. I came across this code which was supposed to fic the problem but the line f.GetValue(..) in last but one line returns null. Can anyone tell me why this is happening -//FIX disable AppDomain restart when deleting subdirectory//This code will turn off monitoring from the root website directory.//Monitoring of Bin, App_Themes and other folders will still be operational, so updated DLLs will still auto deploy.System.Reflection.PropertyInfo p = typeof(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);object o = p.GetValue(null, null);System.Reflection.FieldInfo f = o.GetType().GetField("_dirMonSubdirs", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.IgnoreCase);object monitor = f.GetValue(o);System.Reflection.MethodInfo m = monitor.GetType().GetMethod("StopMonitoring", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); m.Invoke(monitor, new object[] { });

Change image in gridview after binding


I have a need to change the image (bound) in a gridview after it has been databound.  Basically i need to assign a photo to a record and I want to change the image url for that row.  I can change the text in any of the cells of the row but I can't seem to find property for the imageurl.

This is what I do to change the text(cell 5).

int index = int.Parse(Session["NSI"].ToString());

GridViewRow row1 = GridView1.Rows[index];
row1.Cells[5].Text = "just some text";

But now I need to change the image url for cell 0

something along the lines of ...

row1.Cells[0].ImageUrl = "~images\photos\12345.jpg";

How do I get to that property?

Thank you.

clustered node change notification


Hello Friends,


I need a sql server script for my notification for the following.

I have node 1 and node 2 in my clustered environment.


Instances 1 and 2 usually runs on node 1. Instance 2 usually on node 2.


Sometimes they switch without notification. I need to know when they switch. Because I copy files from instances.


Need to know only what instance changed from which node and vice versa.


Any ideas and answers would be greatly appreciated.



Node Change Notification


Hello Friends/Colleagues,


I have 2 nodes active/active with 3 virtual instances.

2 instances on node 1 and 3d instance on node 2.


Sometimes they automatically change from node 1 to node 2.

Is there any way that I get some notification regarding the instance that have changed from one node to another?


I found following may be probable solution:

EXEC master..xp_cmdshell 'cluster resource "SQL Server (Instance Name)"'

Result: Instance Name, Node Name

Put results into table..........Again run the command.....compare.......too much stuff.....

If someone knows the easy path to this.......


How could I get the information that has been changed?


Your help would be really great!



Change the format of List Alert subscription Notification


When we subscribe to any list item for alerts we get an email message for confirmation of successfull subscription.


the email  looks like below :


Subject : You have successfully created an alert for 'Team Discussion: Topic 1


Body ;

Alert 'Team Discussion: Topic 1' has successfully been added on 'Test Site'.

You will receive alerts in e-mail. The timing and criteria for the alerts depend on the settings entered when the alert was added.

You can change this alert or any of your other alerts on the My Alerts on this Site page.


I wish to change the format of this email. Any Inputs ??


Change the default size of http binding - question about


I change the http binding buffer size to be maximum possible.


<binding name="LargeData_basicHttpBinding" maxBufferSize="2147483647" 
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 

Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property

How to Localize Windows Forms and Change the Language at Runtime

Localization is the process of customizing your application to a particular language, culture or locale. Visual Studio provides support for localizing Windows Forms with much ease. In this article, we will see how to localize windows forms and give the user the ability to change to his preferred language at runtime.
When you run a localized application, the appearance is determined by two culture values. The UICulture property is used to specify which resource files will be loaded for the form. The Culture property, on the other hand, determines how strings such as dates, numerals, and currency amounts are formatted.
Let us see the steps required to create a localized form. You can then expand this example and adopt the same approach for the rest of the forms in your project

Binding an array to dropdown list


I have the following string which is a list of urls. How do I get this to work so the url shows for the selection and also is the value?      


allLinks = newAllLinks
        Me.DropDownList1.DataTextField = "Link"
        Me.DropDownList1.DataValueField = "LinkURL"
        Me.DropDownList1.Items.Insert(0, New ListItem(" - Select - ", 0))
        Me.DropDownList1.DataSource = allLinks


 ArgumentNullException: Value cannot be null.
Parameter name: container]
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +121
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName, String format) +8

Binding Nested Listviews in MVC ViewPage


I am a longtime .NET developer but for big applications and services.  This is my first asp.net project and I have chosen MVC.   I have a need for nesting a ListView within a ListView.  In this simple catalog app, I have EF 4 Entities that are Categories, SubCategories, ItemTypes, and Items.

My goal is to display a 5 column layout of SubCategories with their ItemTypes below them in a ViewPage.  I did just fine with it done out in C# as server directives such as:

    var subcats = Model.SubCategory.ToArray();
    var nrSubCats = subcats.Count();
    var rows = (nrSubCats/5) + (((nrSubCats % 5) > 0) ? 1 : 0);
    for (var row = 0; row < rows; row++)
    { %>
        <div style="width: 100%; float: left; clear: right;">
        var start = row * 5;
        for (var i = start; (i < start + 5) && (i < nrSubCats); i++)
        var subcat = subcats[i];
            <div style="float: left; clear: right; width: 20%; margin-left: 5;">
                <h2> <%:subcat.Name%></h2>
                    foreach (var its in subcat.ItemType)

Selected to change the background color of the page



As this site, http://www.borfin.com.tr/genel/Default.aspx, How can I change the background color selected pages.

Bug: Does not change column type from nvarchar to ntext


Scenario: If you create a table with a column of type nvarchar, populate it with some content and try to modify it using the WebMatrix editor, from nvarchar to ntext, it does not display any error message or warning that this is not possible. It silently saves and reverts the change, back to nvarchar. Wasted some hours on this issue as I thought my column was ntext, but in fact was still nvarchar.

Expected behavior: It should change to ntext, or if SQL CE doesn't support that, it should notify the user that no change was applied.

How to change the default page base class?


I've tried setting the <pages pageBaseType="DynamicWebPage" /> value in web.config, but when I response.write out the page type, I'm still getting Microsoft.WebPages.WebPage.

I'm simply trying to sub-class WebPage and add some additional functionality such as a dynamic PageData dictionary similar to Phil Haack's dynamic ViewData dictionary.



Binding GridView with SqlDataSource at runtime?


Hi, I want to create a generic page which contains a gridview and sqldatasource. I want to put these two controls on .aspx (C#) page but bind them at runtime. It should have selectcommand, updatecommand, deletecommand and insertcommand. Stored procedures are created for that. Help is needed to make it. Please post some link or code. Regards, ap.

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