Program!!

11/06/2012 23:39 marlyandedsel#16
Have done it already its easy just auto replace the @@ to ',' and add ; at the end of the line and put Insert command at the first of the line... hell is easy .
11/08/2012 13:50 Mr_PoP#17
uh! here is how am doing it :-

Code:
private void MagicParser() {
            string[] lines = File.ReadAllLines(openFileDialog1.FileName);
            progressBar1.Maximum = lines.Length;

            foreach (string line in lines) {
                string[] str = line.Split(new string[] { "@@", " ", }, StringSplitOptions.RemoveEmptyEntries);
                db.MagicTypes.InsertOnSubmit(new MagicType() {
                    id = Convert.ToInt32(str[0]),
                    type = Convert.ToInt32(str[1]),
                    sort = Convert.ToInt32(str[2]),
                    name = str[3].Trim(),
                    crime = Convert.ToByte(str[4]),
                    ground = Convert.ToByte(str[5]),
                    multi = Convert.ToByte(str[6]),
                    target = Convert.ToInt32(str[7]),
                    level = Convert.ToInt32(str[8]),
                    use_mp = Convert.ToInt32(str[9]),
                    power = Convert.ToInt32(str[10]),
                    intone_speed = Convert.ToInt32(str[11]),
                    percent = Convert.ToInt32(str[12]),
                    step_secs = Convert.ToInt32(str[13]),
                    range = Convert.ToInt32(str[14]),
                    distance = Convert.ToInt32(str[15]),
                    status = Convert.ToInt32(str[16]),
                    need_prof = Convert.ToInt32(str[17]),
                    need_exp = Convert.ToInt32(str[18]),
                    //19 unkown
                    need_level = Convert.ToInt32(str[20]),
                    use_xp = Convert.ToByte(str[21]),
                    weapon_subtype = Convert.ToInt32(str[22]),
                    active_times = Convert.ToInt32(str[23]),
                    auto_active = Convert.ToInt32(str[24]),
                    floor_attr = Convert.ToInt32(str[25]),
                    auto_learn = Convert.ToByte(str[26]),
                    learn_level = Convert.ToInt32(str[27]),
                    drop_weapon = Convert.ToByte(str[28]),
                    use_ep = Convert.ToInt32(str[29]),
                    weapon_hit = Convert.ToByte(str[30]),
                    use_item = Convert.ToInt32(str[31]),
                    next_magic = Convert.ToInt32(str[32]),
                    delay_ms = Convert.ToInt32(str[33]),
                    use_item_num = Convert.ToInt32(str[34]),
                });
                progressBar1.Value += 1;
            }
            db.SubmitChanges();
            progressBar1.Value = 0;
            MessageBox.Show("Done");
        }
now since you are using MySQL not MSSQL ,you have to change the way of inserting every line to the db , in other word make your own QUERY and add to it , the values!!!
11/08/2012 16:27 |xabi|#18
Thanks Mr_POP for your Positive Thread !!
11/08/2012 19:22 _DreadNought_#19
Quote:
Originally Posted by |xabi| View Post
Thanks Mr_POP for your Positive Thread !!
You made the thread, he made a post, Learn the difference.

Judging by your comments in response to what has been said, I'm going to say this how I see it, much like Korvacs would, You simply cannot currently accomplish the task you are attempting.