解决同一列中“字符串”和“数字”两种格式同时存在,读取时,不能正确显示“字符串”格式的问题
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.RestoreDirectory = true;
openFileDialog.DefaultExt = "xls";
openFileDialog.Filter = "Excel files(*.xls)|*.xls";
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
#region Excel to DataSet
string fileName = openFileDialog.FileName;
int i = fileName.LastIndexOf(@"/") + 1;
int i2 = fileName.LastIndexOf(".");
string name = fileName.Substring(i, i2 - i);
//连接Xls文件
//string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =" + fileName + ";Extended Properties=