Empty rows get loaded while Parsing CSV
-
Hi, I parsed a CSV file and loaded in a dataset. All the columns got loaded in the dataset with extra empty cells. I need only the columns in the CSV file with values to be parsed and loaded in Dataset. Can any one help me out. I am using the following Code to parse string ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=\"Text;HDR=No;FMT=Delimited\\\""; System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(ConStr); System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter("Select * from " + file, conn); da.Fill(ds, "TextFile");
-
Hi, I parsed a CSV file and loaded in a dataset. All the columns got loaded in the dataset with extra empty cells. I need only the columns in the CSV file with values to be parsed and loaded in Dataset. Can any one help me out. I am using the following Code to parse string ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=\"Text;HDR=No;FMT=Delimited\\\""; System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(ConStr); System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter("Select * from " + file, conn); da.Fill(ds, "TextFile");
Search CodeProject for an article that shows you how to do this.
xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach." -
Search CodeProject for an article that shows you how to do this.
xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach." -
IF you cant find , neither will I, try harder, I know it's there. Try Google!
xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach." -
Hi, I parsed a CSV file and loaded in a dataset. All the columns got loaded in the dataset with extra empty cells. I need only the columns in the CSV file with values to be parsed and loaded in Dataset. Can any one help me out. I am using the following Code to parse string ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=\"Text;HDR=No;FMT=Delimited\\\""; System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(ConStr); System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter("Select * from " + file, conn); da.Fill(ds, "TextFile");