using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Collections;
using System.Data.SqlClient;
using Microsoft.Office.Core;
using System.Diagnostics;
using System.Reflection;
using Microsoft.Office.Interop.Excel;
//添加引用-->COM-->Microsoft Excel 12.0 Object Library
namespace TestExcel
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private static string connStr = "User Id=sa;Password=123456;Data Source=.;Initial Catalog=TDRDB;";
//查询产品
public static List<Object> getProducList()
{
SqlConnection conn = null;
List<Object> producList = new List<Object>();
string sqlStr = string.Format("select * from production order by type");
try
{
using (conn = new SqlConnection(connStr))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sqlStr, conn);
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交