Click here to Skip to main content
15,899,634 members
Home / Discussions / C#
   

C#

 
AnswerRe: image in byte [] Pin
Mark Salsbery25-Oct-08 5:56
Mark Salsbery25-Oct-08 5:56 
Questionadd resouces (icon) to solution Pin
nelsonpaixao24-Oct-08 13:52
nelsonpaixao24-Oct-08 13:52 
QuestionAssembly Loading Event Pin
pdohara24-Oct-08 11:18
pdohara24-Oct-08 11:18 
AnswerRe: Assembly Loading Event Pin
leppie24-Oct-08 11:48
leppie24-Oct-08 11:48 
GeneralRe: Assembly Loading Event Pin
pdohara26-Oct-08 15:11
pdohara26-Oct-08 15:11 
QuestionUse Web Service in Windows Service Pin
Vicky2Galaxy24-Oct-08 9:54
Vicky2Galaxy24-Oct-08 9:54 
AnswerRe: Use Web Service in Windows Service Pin
Dave Kreskowiak24-Oct-08 16:15
mveDave Kreskowiak24-Oct-08 16:15 
QuestionConvert Console Application C# sharp Method Pin
zjaffary24-Oct-08 8:59
zjaffary24-Oct-08 8:59 
HI

Can anybody help me i wrote the following code in Console application. Now i want to convert it in Method GetContact(String TeamName). i want to call it from Aspx page. It will get the parameter TeamName and pass it to my SQL Where Clause statement. After the following code will generate the xml and save the file c:temp. RightNow it is working fine but only in Console Application. How i can use this code in MY_FOR_CONTACT(string TeamName). I want to give this code to front end developer who use it to create xml file everytime. and save it c:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Xml;
using System.IO;

class ExecuteXmlReader

{public static void Main(){

String TeamName = "gta";
String sConnection = "server=HTCWEBDEMO;database=hometrust;user id=ht_admin;password=htc_tr!st";

//String sConnection = "server=zjaffary\\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 + "';";

SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mySQLStatement, sConnection);

//SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter("SELECT FirstName,LastName,Title,City from employees; select city from employees;", 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();

}

}
AnswerRe: Convert Console Application C# sharp Method Pin
Ennis Ray Lynch, Jr.24-Oct-08 9:06
Ennis Ray Lynch, Jr.24-Oct-08 9:06 
GeneralRe: Convert Console Application C# sharp Method Pin
Vasudevan Deepak Kumar24-Oct-08 9:51
Vasudevan Deepak Kumar24-Oct-08 9:51 
GeneralRe: Convert Console Application C# sharp Method Pin
Ennis Ray Lynch, Jr.24-Oct-08 9:55
Ennis Ray Lynch, Jr.24-Oct-08 9:55 
AnswerRe: Convert Console Application C# sharp Method Pin
Fayu24-Oct-08 9:10
Fayu24-Oct-08 9:10 
AnswerRe: Convert Console Application C# sharp Method Pin
zjaffary25-Oct-08 3:05
zjaffary25-Oct-08 3:05 
GeneralRe: Convert Console Application C# sharp Method Pin
Fayu12-Nov-08 15:46
Fayu12-Nov-08 15:46 
QuestionResuming a download stream Pin
Fayu24-Oct-08 8:57
Fayu24-Oct-08 8:57 
AnswerRe: Resuming a download stream Pin
Ennis Ray Lynch, Jr.24-Oct-08 9:10
Ennis Ray Lynch, Jr.24-Oct-08 9:10 
GeneralRe: Resuming a download stream Pin
Fayu24-Oct-08 9:13
Fayu24-Oct-08 9:13 
GeneralRe: Resuming a download stream Pin
Ennis Ray Lynch, Jr.24-Oct-08 9:22
Ennis Ray Lynch, Jr.24-Oct-08 9:22 
AnswerResolution: Pin
Fayu24-Oct-08 19:13
Fayu24-Oct-08 19:13 
AnswerRe: Resuming a download stream Pin
zjaffary25-Oct-08 3:06
zjaffary25-Oct-08 3:06 
GeneralRe: Resuming a download stream Pin
Guffa25-Oct-08 3:16
Guffa25-Oct-08 3:16 
QuestionPrint error from CaptureAndPrintMSChart project [modified] Pin
ATC24-Oct-08 8:40
ATC24-Oct-08 8:40 
QuestionCapture Screen problem Pin
Xmen Real 24-Oct-08 8:09
professional Xmen Real 24-Oct-08 8:09 
Questionsizing editor Pin
netJP12L24-Oct-08 7:26
netJP12L24-Oct-08 7:26 
Questiondisplaying proxyAddresses attribute on a AD account Pin
lane0p224-Oct-08 5:30
lane0p224-Oct-08 5:30 

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.