5
Answers

Getting an error while uploading from excel file sheet

Ruchi R

Ruchi R

13y
1.7k
1
HI all,

I am getting an error given below when uploading the data from excel file. could anyone plz help me soon.

"The Microsoft Office Access database engine could not find the object 'Sheet1$'.  Make sure the object exists and that you spell its name and the path name correctly."
Answers (5)
0
Vulpes

Vulpes

NA 98.3k 1.5m 11y
To center the column header text, you can do:

dataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

To set all the columns to the same width, I think you'll have to set them individually as I can't find a property to do this 'en bloc'.
0
viva

viva

NA 27 22.3k 11y
thanks for your reply but I didnt get HorizontalAlign="Center" in HeaderStyle and ItemStyle

Can you please answer it specifically for datagrid view? and wherethese settings are??
0
Kiresh Gangariya

Kiresh Gangariya

NA 214 1.8k 11y
try to give HorizontalAlign="Center" in HeaderStyle and ItemStyle