本文介绍了将文本框数据保存在Excel工作表.xlsx中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的代码中我使用mydata base作为excel表,我只能在 excel sheet97-2003(.xls)上保存,但想要保存在 excel sheet2007(。 xlsx)



In the below code am using mydata base as excel sheet where i can able to save only on excel sheet97-2003(.xls), but want to save in excel sheet2007(.xlsx)

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


       TxtExamtime.Format = DateTimePickerFormat.Custom
       TxtExamtime.CustomFormat = "hh:mm tt"
       cn.ConnectionString = "provider=microsoft.jet.oledb.4.0; Data Source=C:\psave\New folder\save.xls;Extended Properties=Excel 8.0;"
       cn.Open()

       FillDataGridView1("select ID, [Family Name], [Given Name], Gender, DOB, [Street Name], [House Nr], Postcode, City FROM [Sheet1$]  WHERE ID IS NOT NULL AND [Family Name] IS NOT NULL AND [Given Name] IS NOT NULL AND Gender IS NOT NULL AND DOB IS NOT NULL AND [Street Name] IS NOT NULL AND [House Nr] IS NOT NULL AND Postcode IS NOT NULL AND City IS NOT NULL ")

       FillDataGridView2("select [Procedure Code], [Procedure name] from[Sheet2$] WHERE [Procedure Code] IS NOT NULL AND [Procedure name] IS NOT NULL ")
   End Sub

推荐答案




这篇关于将文本框数据保存在Excel工作表.xlsx中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 21:16