Select Data in Worksheet 1

J

Jim M

I am able to select data from worksheet 1 if I know the sheet name...

OleDbCommand objCmdSelect =new OleDbCommand("SELECT * FROM [Sheet1$]",
objConn);

How would I just get the data from the first (primary sheet) if I do not
know the name of Sheet1$ ?

Thanks in advance!
 
B

Bob Phillips

Jim,

This self-same question was asked back in April. Here is my suggested
solution using ADOX to get that first sheet name
http://tinyurl.com/yw6dp

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top