I am trying to put together a simple program to read in a comma delimited file and store to database table but I am getting an error with my dataset "Cannot find table 0."
SqlCommand cmdSql = new SqlCommand( "Select Top 1 From Mytable", conn );
DataSet ds = new DataSet();
dg.DataSource = cmdSql.ExecuteReader();
foreach (string a in split)
ds.Tables.Rows[RowCounter][ColCounter]= a; "Error occurs here"
I am just trying to copy the contents from my text file to a column in the DatSet table. What am I missing?