vendredi 29 avril 2016

when i convert CSV file and saves it to database it saves data in database between " ",so how can i remove " "

'this is my comma separated value file conversion code , string deliminator = ",";

 string tablename = "Converted";
        //string filelink = FileName.Text;
        string fileintro = FileName.Text;
        DataSet DS = new DataSet();
        StreamReader SR = new StreamReader(fileintro.Trim());
        DS.Tables.Add(tablename);

    DS.Tables[tablename].Columns.Add("A");
    DS.Tables[tablename].Columns.Add("B");
    DS.Tables[tablename].Columns.Add("C");
    DS.Tables[tablename].Columns.Add("D");
    DS.Tables[tablename].Columns.Add("E");
    DS.Tables[tablename].Columns.Add("F");
    DS.Tables[tablename].Columns.Add("G");
    DS.Tables[tablename].Columns.Add("H");
    DS.Tables[tablename].Columns.Add("I");

SQLiteConnectionconn=newSQLiteConnection(ConfigurationManager.ConnectionStrings["dbcon"].ConnectionString);

SQLiteCommand cmd = new SQLiteCommand ("INSERT INTO ConvertData (a,b,c,d,e,f) values ('"+a+"'...), con);

                cmd.ExecuteNonQuery();
                co.Close();
                FileName.Text = "";
   }

it saves data in database table like "1,2,3,4,5,6,7" so how can i save it normally like 1,2,3,4,5,6,into database columns.'

Aucun commentaire:

Enregistrer un commentaire