Jump to content

xaviermalcolm

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About xaviermalcolm

  • Rank
    Newbie
  1. Could you also tell me where do I need to put the code you mentioned? In the aspx file or the aspx.cs file.My aspx.cs file currently looks like thisusing System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Data.SqlClient;using System.Xml.Serialization;using System.Xml;using System.IO;using System.Xml.Xsl;using System.Text;public partial class SearchPage : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { SqlConnection myConn = new SqlConnection(); myConn.ConnectionString = "Data Source=XG7;Initial Catalog=Car_Share_XG;Integrated Security=True"; myConn.Open(); SqlCommand command = new SqlCommand(); command.CommandText = "SELECT * FROM tbl_Member"; command.CommandType = CommandType.Text; command.Connection = myConn; SqlDataAdapter da = new SqlDataAdapter(command); DataSet ds = new DataSet(); da.Fill(ds, "tbl_Member"); // Get a FileStream object StreamWriter xmlDoc = new StreamWriter(Server.MapPath("./Data2.xml"), false); // Apply the WriteXml method to write an XML document ds.WriteXml(xmlDoc); xmlDoc.Close(); myConn.Close(); } protected void btnSearch_Click(object sender, EventArgs e) { }}
  2. No there is more than one address in the second XML file.
  3. Hi Everyone,I am having trouble to use the XML file populate by the database.Currently I have this XML file which is allowing me to plot icons on google map. But I want to use the XML file populated by the database as reference to plot the icons on the map.So I was wondering how can I use the second XML file the same way as the first XML file? Or is there anyway I can convert the output of the second XML file to look like the first XML file?First XML File:<markers> <marker address="Ayshe Court Drive"/> <marker address="Gossops Green"/> <marker address="Withdean"/></markers>Second XML File:<NewDataSet> <tbl_Member> <Member_Email>asdsd</Member_Email> <Member_Firstname>ada</Member_Firstname> <Member_Lastname>asdsd</Member_Lastname> <Member_password>carshare</Member_password> <Member_YOB>0000</Member_YOB> <Member_Gender>Male</Member_Gender> <Member_Address>Withdean</Member_Address> <Member_Gender_pref>Male</Member_Gender_pref> <Member_Smoker_Status>Non-Smoker</Member_Smoker_Status> <Member_Smoker_Pref>Both</Member_Smoker_Pref> <Journey_Offering>Both</Journey_Offering> <Member_Car_Space_Avail>0</Member_Car_Space_Avail> </tbl_Member></NewDataSet>As you can see the second XML file is formatted in a different way. And I cant get my asp page to select addresses from the second XML file.
×
×
  • Create New...