之前的程序得到的排序是以字母来排序的,但是实际上我们常常需要按表中的顺序来排序, 网上没搜到,后来简单改了下代码实现想要的结果。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace test_access0411
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
public static string[] get_a_table_colnames(string _connectionstr, string _tablename)
{
string sql1 = "select * from " + _tablename;
OleDbConnection OleDbConnection1