[問題] 用C#去對EXCEL資料選取的問題
string str_select = "Select * From [sheet_A$]";
OleDbCommand sqlcmd = new OleDbCommand(str_select);
sqlcmd.Connection = cn;
OleDbDataAdapter oleda = new OleDbDataAdapter(str_select, cn);
oleda.Fill(dt);
上述的code是抓取Excel sheet_A的資料
請問一下,如果只想抓sheet_A中column A,B的資料,
str_select要怎麼改呢?
感謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 112.105.109.165
→
08/20 21:31, , 1F
08/20 21:31, 1F
→
08/20 21:35, , 2F
08/20 21:35, 2F
→
08/20 21:37, , 3F
08/20 21:37, 3F
→
08/20 21:42, , 4F
08/20 21:42, 4F
→
08/20 21:43, , 5F
08/20 21:43, 5F
→
08/26 23:29, , 6F
08/26 23:29, 6F
→
08/26 23:30, , 7F
08/26 23:30, 7F