Click here to Skip to main content
15,884,298 members
Home / Discussions / C#
   

C#

 
AnswerRe: file contents Pin
Keith Barrow9-Apr-10 4:26
professionalKeith Barrow9-Apr-10 4:26 
GeneralRe: file contents Pin
Morgs Morgan9-Apr-10 4:42
Morgs Morgan9-Apr-10 4:42 
GeneralRe: file contents Pin
Keith Barrow9-Apr-10 4:48
professionalKeith Barrow9-Apr-10 4:48 
GeneralRe: file contents Pin
Morgs Morgan9-Apr-10 4:56
Morgs Morgan9-Apr-10 4:56 
GeneralRe: file contents Pin
Keith Barrow9-Apr-10 5:00
professionalKeith Barrow9-Apr-10 5:00 
GeneralRe: file contents Pin
Morgs Morgan9-Apr-10 5:33
Morgs Morgan9-Apr-10 5:33 
GeneralRe: file contents Pin
Keith Barrow9-Apr-10 5:42
professionalKeith Barrow9-Apr-10 5:42 
GeneralRe: file contents Pin
Morgs Morgan9-Apr-10 5:51
Morgs Morgan9-Apr-10 5:51 
Cool bro I have figured it out check below:

manager = new data_manager();
            HttpPostedFile myFile = files.PostedFile;// Get a reference to PostedFile object
            string strFilename = Path.GetFileName(myFile.FileName);
            if (strFilename != "")
            {
                string[] lines = File.ReadAllLines(strFilename);
                for (int b = 0; b < lines.Length; b++)
                {
                    string[] fragments = lines[b].Split(',');
                    int count = lines.Length;
                    errors.Text = fragments[0] + count.ToString();
                    errors.Visible = true;
                    string first = fragments[0]; string last = fragments[1]; string email = fragments[2];
                    string phone = fragments[3]; string birth = fragments[4];
                    string addrecord = manager.AddContact(first, last, email, phone, birth, Request.QueryString["userid"]);

                    if (addrecord == "done")
                    {
                        error.Text = "Contact added check in the table below!";
                        error.Visible = true;
                        FillContacts(Request.QueryString["userid"]);//update datagrid after deleting a contact
                    }
                    else
                    {
                        error.Text = addrecord;
                        error.Visible = true;
                    }
                }
            }
            else
            {
                errors.Text = "No file with content was selected";
                errors.Visible = true;
            }

and this works quiet well....super! Laugh | :laugh:
AnswerRe: file contents Pin
Sandesh M Patil9-Apr-10 4:46
Sandesh M Patil9-Apr-10 4:46 
GeneralRe: file contents Pin
Keith Barrow9-Apr-10 4:59
professionalKeith Barrow9-Apr-10 4:59 
GeneralRe: file contents Pin
Sandesh M Patil9-Apr-10 5:16
Sandesh M Patil9-Apr-10 5:16 
GeneralRe: file contents Pin
Keith Barrow9-Apr-10 5:20
professionalKeith Barrow9-Apr-10 5:20 
GeneralRe: file contents Pin
Sandesh M Patil9-Apr-10 5:25
Sandesh M Patil9-Apr-10 5:25 
GeneralRe: file contents Pin
Keith Barrow9-Apr-10 5:37
professionalKeith Barrow9-Apr-10 5:37 
GeneralRe: file contents Pin
Pete O'Hanlon9-Apr-10 7:38
mvePete O'Hanlon9-Apr-10 7:38 
GeneralRe: file contents Pin
Pete O'Hanlon9-Apr-10 8:11
mvePete O'Hanlon9-Apr-10 8:11 
AnswerRe: file contents Pin
Ghydo9-Apr-10 4:56
Ghydo9-Apr-10 4:56 
GeneralRe: file contents Pin
Morgs Morgan9-Apr-10 4:58
Morgs Morgan9-Apr-10 4:58 
QuestionC# Exception Pin
amitk_1899-Apr-10 4:13
amitk_1899-Apr-10 4:13 
AnswerRe: C# Exception Pin
Sandesh M Patil9-Apr-10 4:28
Sandesh M Patil9-Apr-10 4:28 
QuestionProcess in C#.. [modified] Pin
Sr...Frank9-Apr-10 4:06
Sr...Frank9-Apr-10 4:06 
AnswerRe: Process in C#.. Pin
Ian Shlasko9-Apr-10 4:14
Ian Shlasko9-Apr-10 4:14 
GeneralRe: Process in C#.. Pin
Sr...Frank9-Apr-10 4:18
Sr...Frank9-Apr-10 4:18 
GeneralRe: Process in C#.. Pin
Sr...Frank9-Apr-10 4:20
Sr...Frank9-Apr-10 4:20 
GeneralRe: Process in C#.. Pin
Ian Shlasko9-Apr-10 4:36
Ian Shlasko9-Apr-10 4:36 

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.