0

can you kindly help me load my gridview with data from appsetings.xml . the gridview must have the following three columns(key,value and description)

here is my appsettings.xml.

<?xml version="1.0"?>
<configuration>
  <Global>
    <FromEmail value="test@uiplay.com"
               description="From Email Address Name" />
    <AdminEmail value="cmckowen@gmail.com"
                description="Admin Email Used for Admin Test and Unsubscribe Comments" />
  </Global>
  <Data>
    <!--<Connection value="server=localhost;database='PolicyNet';uid='sa';pwd='sa123!'"
                description="Default Database Connection String" />-->
    <!--<Connection value="server=wormwood;database='PolicyNet';uid='PolicyNetTest';pwd='PNet123!'"
                description="Default Database Connection String" />-->
    <Connection value="server=196.14.77.139;database='PolicyNetTest';uid='PolicyNetTest';pwd='PNet123!'"
                description="Default Database Connection String" />
    <!-- 196.14.77.139 -->
   
    <AllowManualStoredProcedureExecution value="false"
                                         description="allow execution of stored procedures from outside data classes (bad practice!)" />
    <SqlPath value="Data/sql"
             description="Path to the XML Query Files"/>
  </Data>
  <Users>
    <EncryptionData value="(rS06BeTdkbD9TB9RUWQWESvsJUs+kw82wcTlN2e+8NBAB87CPkT/gl3sDQnh4NbjhzQJB36h6KTNX80HeQHnNw==)"
                    description="Encryption data" />
  </Users>
  <Communication>
    <Mail>
      <SmtpServer value="127.0.0.1" description="SMTP Server Used By Newsletter Application" />
    </Mail>
    <Sms>
      <LogicSms>
        <Username value="Ronelle@UIPLAY" description="Username for LogicSms" />
        <Password value="wong2fu" description="Password for LogicSms" />
      </LogicSms>
    </Sms>
  </Communication>
  <CMS>
    <Handlers>
      <DelayedResponseHandler.Timeout value="50000"
                                      description="Timeout for DelayedResponseHandler" />
    </Handlers>
  </CMS>
  <CRM>
    <CampaignTools>
      <Newsletter>
        <FromEmail value="test@uiplay.com"
                   description="Address used as from field for newsletters" />
        <UnsubscribeLinkFormat value="http://localhost:100/index.aspx?PageKey=Unsubscribe&amp;Id=[:ContactId:]"
                               description="Url used to unsubrscribe a contact" />
      </Newsletter>
    </CampaignTools>
  </CRM>

  <PayinDueDay value="24"
               description="Day by which Pay-ins should be entered." />
</configuration>

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by owenshiri
0

i have tried using the ReadXml method already but it seems as if the dataset is splitting the apsettings.xml data into 24 tables whilst i want it in a single table with three columns.

here is the code

public static DataSet GetDataSet()
        {
            var ds = new DataSet();
           ds.ReadXml("~/data/AppSettings.xml");
           return ds;
        }

bt after debugging, the method returns ds with 24 tables

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.