The example in this article describes how C # forms read Excel and deposit into SQL database. Share to everyone for your reference. The implementation method is as follows:
A textbox1,2 button is placed on a Windows Form button1 and button2~ Press button1 select Excel file ~ Press Button2 for related processing
The code is as follows:
private void Button1_Click (Object Sendeer,eventargs e)
{
OpenFileDialog openfiledialog1=new OpenFileDialog ();
openfiledialg1.filter= "Excel file |*.xls";
Openfiledialg1.showdialog ();
Textbox1.text=openfiledialog1.filename;
}
private void Button2_Click (object sender, EventArg e)
{
DataSet Dt=readexcel (TextBox1.Text);
And then do the data you need.
}
In addition to the Declaration,
Running GuestArticles are original, reproduced please link to the form of the address of this article
C # Forms How to read Excel and deposit SQL database
This address: http://www.paobuke.com/develop/c-develop/pbk23190.html
Related Content C # Public method class instance for date format Conversion C # Determines if a string is a numeric type c#êμ?? 3ìdò?a?ú??? ˉμ?? ¨c# How to do multithreaded programming in Unity game development
C # Implementing taskbar notification window C # Loop statement collection and case study C # methods for reading parameters from the command line delegate introduction in C #
C # Forms How to read Excel and deposit SQL database