Click here to Skip to main content
15,925,243 members
Home / Discussions / C#
   

C#

 
QuestionClose a form ? Pin
Assaf8213-Nov-07 22:23
Assaf8213-Nov-07 22:23 
AnswerRe: Close a form ? Pin
Christian Graus13-Nov-07 22:28
protectorChristian Graus13-Nov-07 22:28 
AnswerRe: Close a form ? Pin
e_zakhour13-Nov-07 22:29
e_zakhour13-Nov-07 22:29 
QuestionPrinting in csharp Pin
e_zakhour13-Nov-07 22:23
e_zakhour13-Nov-07 22:23 
AnswerRe: Printing in csharp Pin
Abhijit Jana13-Nov-07 22:29
professionalAbhijit Jana13-Nov-07 22:29 
QuestionText box help Pin
KppsK13-Nov-07 22:22
KppsK13-Nov-07 22:22 
AnswerRe: Text box help Pin
Giorgi Dalakishvili13-Nov-07 22:26
mentorGiorgi Dalakishvili13-Nov-07 22:26 
QuestionErrors with Export to CSV From DB Pin
MumbleB13-Nov-07 21:51
MumbleB13-Nov-07 21:51 
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();

}

AnswerRe: Errors with Export to CSV From DB Pin
Bino B13-Nov-07 21:56
Bino B13-Nov-07 21:56 
GeneralRe: Errors with Export to CSV From DB Pin
MumbleB13-Nov-07 22:01
MumbleB13-Nov-07 22:01 
QuestionRe: Errors with Export to CSV From DB Pin
MumbleB13-Nov-07 22:41
MumbleB13-Nov-07 22:41 
QuestionComparing buttons's bacgroundimages in decision structures Pin
omegazafer13-Nov-07 21:47
omegazafer13-Nov-07 21:47 
QuestionHello again Pin
e_zakhour13-Nov-07 21:31
e_zakhour13-Nov-07 21:31 
AnswerRe: Hello again Pin
Abhijit Jana13-Nov-07 21:35
professionalAbhijit Jana13-Nov-07 21:35 
AnswerRe: Hello again Pin
Bino B13-Nov-07 22:00
Bino B13-Nov-07 22:00 
GeneralRe: Hello again Pin
Colin Angus Mackay13-Nov-07 23:40
Colin Angus Mackay13-Nov-07 23:40 
AnswerRe: Hello again Pin
Christian Graus13-Nov-07 22:10
protectorChristian Graus13-Nov-07 22:10 
AnswerRe: Hello again Pin
Pete O'Hanlon13-Nov-07 22:11
mvePete O'Hanlon13-Nov-07 22:11 
QuestionHello All, Any Help please Pin
e_zakhour13-Nov-07 21:20
e_zakhour13-Nov-07 21:20 
AnswerRe: Hello All, Any Help please Pin
Bino B13-Nov-07 21:25
Bino B13-Nov-07 21:25 
AnswerRe: Hello All, Any Help please Pin
Abhijit Jana13-Nov-07 21:27
professionalAbhijit Jana13-Nov-07 21:27 
QuestionDigital Camera Control with c# Pin
Vicky2Galaxy13-Nov-07 19:54
Vicky2Galaxy13-Nov-07 19:54 
AnswerRe: Digital Camera Control with c# Pin
N a v a n e e t h13-Nov-07 19:56
N a v a n e e t h13-Nov-07 19:56 
AnswerRe: Digital Camera Control with c# Pin
Christian Graus13-Nov-07 20:03
protectorChristian Graus13-Nov-07 20:03 
AnswerRe: Digital Camera Control with c# Pin
Vasudevan Deepak Kumar13-Nov-07 20:07
Vasudevan Deepak Kumar13-Nov-07 20:07 

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.