Click here to Skip to main content
15,911,035 members
Home / Discussions / C#
   

C#

 
AnswerRe: How To Start Service In Setup Application Pin
Abhijit Jana14-Nov-07 1:20
professionalAbhijit Jana14-Nov-07 1:20 
QuestionProblem with invoking new thread with socket parameter Pin
Coyote.Max14-Nov-07 1:09
Coyote.Max14-Nov-07 1:09 
AnswerRe: Problem with invoking new thread with socket parameter Pin
TJoe14-Nov-07 2:13
TJoe14-Nov-07 2:13 
GeneralRe: Problem with invoking new thread with socket parameter Pin
Coyote.Max14-Nov-07 4:35
Coyote.Max14-Nov-07 4:35 
QuestionParsing strings into TimeSpans Pin
Vikram A Punathambekar14-Nov-07 1:02
Vikram A Punathambekar14-Nov-07 1:02 
AnswerRe: Parsing strings into TimeSpans Pin
Pete O'Hanlon14-Nov-07 2:19
mvePete O'Hanlon14-Nov-07 2:19 
GeneralRe: Parsing strings into TimeSpans Pin
Vikram A Punathambekar14-Nov-07 3:38
Vikram A Punathambekar14-Nov-07 3:38 
QuestionHelp with Data Export Pin
MumbleB14-Nov-07 0:40
MumbleB14-Nov-07 0:40 
Hi Guys. I have managed to get some code to export data in my Access DB to a CSV file. Now, I have two small issues.
1. I want to mark all the records as they are exported to Y in a column named exported and only export all the records marked as N. Anybody have a suggestion on how I could do this in the export code?
2. When I open the CSV file in Excel I get a few errors. First error says that the file is in a different format than the one specified by the extention. It allows you to continue and then comes up with error "Cannot read the 1st record. The it reports yet another error which says that Excel has determined the file to be a SYLK file but not load it" but it still imports the data into Excel. Any ideas on how I get past this?

Code below:
private void toolStripButton2_Click(object sender, EventArgs e)
{

    StreamWriter sw = new StreamWriter(@"C:\nefz.csv", false);
    DataTable dt = m_dtCallCentre;
    int iColCount = dt.Columns.Count;
    for (int i = 0; i < iColCount; i++)
    {
        sw.Write(dt.Columns[i]);
        if (i < iColCount - 1)
        {
            sw.Write(";");
        }
    }
    sw.Write(sw.NewLine);
    foreach (DataRow dr in dt.Rows)
    {
        for (int i = 0; i < iColCount; i++)
        {
            if (!Convert.IsDBNull(dr[i]))
            {
                sw.Write(dr[i].ToString());
            }
            if (i < iColCount - 1)
            {
                sw.Write(";");
            }
        }
        sw.Write(sw.NewLine);
    }
    sw.Close();

}


I was advised earlier by oneof the guys to go into the DB and run the export from there. This would defeat the pupose of writing code I think so if anybody else can help me out with this then I would greatly appreciate it.
AnswerRe: Help with Data Export Pin
Rob Philpott14-Nov-07 2:21
Rob Philpott14-Nov-07 2:21 
GeneralRe: Help with Data Export Pin
MumbleB14-Nov-07 7:57
MumbleB14-Nov-07 7:57 
QuestionHow to start service Pin
Boroumandan14-Nov-07 0:35
Boroumandan14-Nov-07 0:35 
AnswerRe: How to start service Pin
Abhijit Jana14-Nov-07 0:43
professionalAbhijit Jana14-Nov-07 0:43 
GeneralRe: How to start service Pin
Boroumandan14-Nov-07 0:49
Boroumandan14-Nov-07 0:49 
GeneralRe: How to start service Pin
Abhijit Jana14-Nov-07 1:10
professionalAbhijit Jana14-Nov-07 1:10 
QuestionFilecopy in windows service and win application Pin
amitcoder8314-Nov-07 0:34
amitcoder8314-Nov-07 0:34 
AnswerRe: Filecopy in windows service and win application Pin
Boroumandan14-Nov-07 0:39
Boroumandan14-Nov-07 0:39 
GeneralRe: Filecopy in windows service and win application Pin
amitcoder8314-Nov-07 0:44
amitcoder8314-Nov-07 0:44 
AnswerRe: Filecopy in windows service and win application Pin
Vikram A Punathambekar14-Nov-07 1:05
Vikram A Punathambekar14-Nov-07 1:05 
GeneralRe: Filecopy in windows service and win application Pin
amitcoder8314-Nov-07 1:53
amitcoder8314-Nov-07 1:53 
QuestionI want to enter only Negative values,Positive values,Decimal values in TextBox Pin
g_hemanth1714-Nov-07 0:01
g_hemanth1714-Nov-07 0:01 
AnswerRe: I want to enter only Negative values,Positive values,Decimal values in TextBox Pin
Christian Graus14-Nov-07 0:12
protectorChristian Graus14-Nov-07 0:12 
AnswerRe: I want to enter only Negative values,Positive values,Decimal values in TextBox Pin
Xmen Real 14-Nov-07 0:26
professional Xmen Real 14-Nov-07 0:26 
GeneralRe: I want to enter only Negative values,Positive values,Decimal values in TextBox Pin
g_hemanth1714-Nov-07 0:49
g_hemanth1714-Nov-07 0:49 
GeneralRe: I want to enter only Negative values,Positive values,Decimal values in TextBox Pin
Sri_346414-Nov-07 0:54
Sri_346414-Nov-07 0:54 
GeneralRe: I want to enter only Negative values,Positive values,Decimal values in TextBox Pin
g_hemanth1714-Nov-07 1:19
g_hemanth1714-Nov-07 1:19 

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.