Click here to Skip to main content
15,921,174 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionrepeater header template not displayed on webpage Pin
Ravikumar.Y25-Oct-08 9:52
Ravikumar.Y25-Oct-08 9:52 
AnswerRe: repeater header template not displayed on webpage Pin
Ravikumar.Y25-Oct-08 23:04
Ravikumar.Y25-Oct-08 23:04 
QuestionAjax timer in gridview. Pin
VijayVishwakarma25-Oct-08 9:34
VijayVishwakarma25-Oct-08 9:34 
QuestionCSS working in IE7 but Not in firefox 2 Pin
AlexeiXX325-Oct-08 7:54
AlexeiXX325-Oct-08 7:54 
AnswerRe: CSS working in IE7 but Not in firefox 2 Pin
Guffa25-Oct-08 17:11
Guffa25-Oct-08 17:11 
GeneralRe: CSS working in IE7 but Not in firefox 2 Pin
AlexeiXX326-Oct-08 17:24
AlexeiXX326-Oct-08 17:24 
GeneralRe: CSS working in IE7 but Not in firefox 2 Pin
Guffa26-Oct-08 23:28
Guffa26-Oct-08 23:28 
QuestionCreating XMLFile in Asp.net How to format the output Pin
zjaffary25-Oct-08 3:13
zjaffary25-Oct-08 3:13 
Hi
I have written the following asp.net page and creating the xml file through a method everything is fine it is creating the file but i have a problem. May be you can help for that. it is about the xml file output when it created it showing TABLE and TABLE1 as node in xml how i can change it to meaningful name. My Code is as follows. XML file is at the bottom of the code

using System;
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.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Xml;
using System.IO;

public partial class _Default : System.Web.UI.Page

{protected void Page_Load(object sender, EventArgs e){

GetEmployees("London");
}

public static void GetEmployees(string City){
//String sConnection = "server=HTCWEBDEMO;database=hometrust;user id=ht_admin;password=htc_tr!st";
String sConnection = "server=ZAFAR-PC\\SQLEXPRESS;Integrated Security=SSPI;database=northwind";
SqlConnection mySqlConnection = new SqlConnection(sConnection);

mySqlConnection.Open();

// Get the same data through the provider.
//string mySQLStatement = "SELECT Title,FirstName,LastName,PhoneNumber,Faxnumber, email from contactlist where TeamName='" + TeamName +"'; select FirstName, LastName from contactlist where TeamMorty ='True' and teamname='" + TeamName + "';";

string mySQLStatement = "SELECT FirstName,LastName,Title,City from employees where city= '" + City + "';select FirstName, LastName from employees where city='" + City + "';";

//SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mySQLStatement, sConnection);

SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mySQLStatement, sConnection);
DataSet myDataSet2 = new DataSet();
myDataSet2.DataSetName = "Contacts";
mySqlDataAdapter.Fill(myDataSet2);

// Write data to files: data1.xml and data2.xml for comparison.

myDataSet2.WriteXml("c:/temp/ContactList.xml");
mySqlConnection.Close();
}

}

XML FILE OUTPUT

<?xml version="1.0" standalone="yes" ?>
- <Contacts>
- <Table>
<FirstName>Steven</FirstName>
<LastName>Buchanan</LastName>
<Title>Sales Manager</Title>
<City>London</City>
</Table>
- <Table>
<FirstName>Michael</FirstName>
<LastName>Suyama</LastName>
<Title>Sales Representative</Title>
<City>London</City>
</Table>
- <Table>
<FirstName>Robert</FirstName>
<LastName>King</LastName>
<Title>Sales Representative</Title>
<City>London</City>
</Table>
- <Table>
<FirstName>Anne</FirstName>
<LastName>Dodsworth</LastName>
<Title>Sales Representative</Title>
<City>London</City>
</Table>
- <Table1>
<FirstName>Steven</FirstName>
<LastName>Buchanan</LastName>
</Table1>
- <Table1>
<FirstName>Michael</FirstName>
<LastName>Suyama</LastName>
</Table1>
- <Table1>
<FirstName>Robert</FirstName>
<LastName>King</LastName>
</Table1>
- <Table1>
<FirstName>Anne</FirstName>
<LastName>Dodsworth</LastName>
</Table1>
</Contacts>
GeneralData in Gridview ASP .Net on button click event Pin
Shazz Rock25-Oct-08 2:34
Shazz Rock25-Oct-08 2:34 
GeneralRe: Data in Gridview ASP .Net on button click event Pin
NetMan201225-Oct-08 2:48
NetMan201225-Oct-08 2:48 
QuestionWhat is web.config if we are using multiple languges in a website? Pin
NetMan201225-Oct-08 2:20
NetMan201225-Oct-08 2:20 
QuestionHow to use DropDownList with C#.NET Pin
mghiassi24-Oct-08 23:59
mghiassi24-Oct-08 23:59 
AnswerRe: How to use DropDownList with C#.NET Pin
Parwej Ahamad25-Oct-08 0:05
professionalParwej Ahamad25-Oct-08 0:05 
AnswerRe: How to use DropDownList with C#.NET Pin
slSoftware25-Oct-08 7:09
slSoftware25-Oct-08 7:09 
Questionhow to send a email.... Pin
raghvendrapanda24-Oct-08 22:10
raghvendrapanda24-Oct-08 22:10 
AnswerRe: how to send a email.... Pin
Abhijit Jana24-Oct-08 23:30
professionalAbhijit Jana24-Oct-08 23:30 
GeneralRe: how to send a email.... Pin
raghvendrapanda25-Oct-08 0:15
raghvendrapanda25-Oct-08 0:15 
GeneralRe: how to send a email.... Pin
Abhijit Jana25-Oct-08 0:23
professionalAbhijit Jana25-Oct-08 0:23 
GeneralRe: how to send a email.... Pin
raghvendrapanda25-Oct-08 2:02
raghvendrapanda25-Oct-08 2:02 
GeneralRe: how to send a email.... Pin
Abhijit Jana25-Oct-08 2:15
professionalAbhijit Jana25-Oct-08 2:15 
GeneralRe: how to send a email.... Pin
raghvendrapanda25-Oct-08 2:35
raghvendrapanda25-Oct-08 2:35 
AnswerRe: how to send a email.... Pin
Shazz Rock25-Oct-08 2:38
Shazz Rock25-Oct-08 2:38 
Questionasp:Timer control now working in gridview Pin
VijayVishwakarma24-Oct-08 21:56
VijayVishwakarma24-Oct-08 21:56 
QuestionTextBox id problem Pin
raghvendrapanda24-Oct-08 21:27
raghvendrapanda24-Oct-08 21:27 
AnswerRe: TextBox id problem Pin
Abhijit Jana24-Oct-08 22:04
professionalAbhijit Jana24-Oct-08 22:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.