Hi,
Im working with an excel file. For exampler there is 500 rows in the sheet and 4 columns in the sheet. First 3 columns have data but 4th columns is empty. I want to write this column's all rows' "1. row", "2. row", "3.row"...
My codes below.. How can i do that?

4.th colon
-------
1.row
2.row
3.row
...
------

string query_ci = "SELECT [Kolon1],[Kolon2],[Kolon3] FROM[Sheet6$A:J] WHERE [Kolon1]='" + kolon_bul+ "'";
                OleDbDataReader rdr_ci;
                OleDbCommand komut_ci = new OleDbCommand(query_ci, conn);
                rdr_ci = komut_ci.ExecuteReader();
                int a=0;
                while (rdr_ci.Read())
                {

                        OleDbCommand komut = new OleDbCommand("UPDATE [Sheet6$] SET [Kategori]='"+a.ToString()+ column"' WHERE="??????"  ", baglanti);     ----> What should be here?
                        komut.ExecuteNonQuery();
                a += 1;
 
               }

Recommended Answers

All 3 Replies

Any idea?

I, for one, don't know what it is you are trying to do as you aren't very clear.

"where row = '4'"? It is hard to interpret your code. Sounds like you have a sql-issue, not a C# issue.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.