-_dataset tostring???

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

// I'm using Visual Studio C# and the 'EmailMessage' class. Here you see me
attempting to retrieve data

// from: newDataSet1 (dataset), Settings (table), SmtpServer (data column)
and convert ToString (strSmtpServer)!

// However what I have below retreives the DataColumn name and NOT the
actual data (ie... smtp.yahoo.com).

// I feel I'm so close is scarry...

//Create the SMTP object using the constructor to specify the mail server

string strSmtpServer = (newDataSet1.Settings.SmtpServerColumn.ToString());

SMTP smtpObj = new SMTP (strSmtpServer);


//Send the message

smtpObj.Send(msgObj);

// Have mercy on this newbie and help...



Please Reply to this email: (e-mail address removed)
 
Hi Kevin:

yep, that isn't going to work. I'd advise taking your dataset and Calling
its .WriteXml method ie newDataSet1.WriteXML(@"..\attachment.xml");
Then use this file and send it as an attachment. If you need it to appear in
the method, you're going to have to do loop through the rows, then at each
row loop through the columns, and write out the data - if there's another
way I don't know of it.

HTH,

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top