Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select From Multiple SQL Server(s)
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00682947
Message ID:
00683017
Vues:
32
This message has been marked as a message which has helped to the initial question of the thread.
To access the information, you need to access the DataSet like you normally do. The name of the table created is "ServerName". You can access the information by using the table name or by using the index. By using an index, you are making the routine more generic if you decide to change the XML name.
TextBox1.Text = oData.Tables(0).Rows(0)(0).ToString()
oData.Tables(0) represents the first DataTable in the DataSet
.Rows(0) represents the first row in the DataTable
.Rows(0)(0) represents the first column of the first row in the DataTable


>Mario
>
>I built my XML file and tried to do the binding, but I'm getting the following error:
>Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name ServerName.
>
>I'm not sure how to specify what the fields are.
>
>
>Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
>     Dim oData As New DataSet()
>     oData.ReadXml("c:\ServerData.xml")
>     Me.DropDownList1.DataSource = oData
>     Me.DropDownList1.DataValueField = "ServerName"
>     Me.DropDownList1.DataTextField = "ServerName"
>     Page.DataBind()
>
>End Sub
>
>
>XML File Contents
>
>
><?xml version="1.0" encoding="Windows-1252"?>
><!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Kirk Kelly (CQI) -->
><configuration>
>	<SERVERNAME>CQI-TERMSERV</SERVERNAME>
>	<SERVERNAME>(LOCAL)</SERVERNAME>
></configuration>
>
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform