110,529
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace DataBaseAccess
{
class DataStructure
{
private DataStructure()
{
}
private void GetDate()
{
string strCon = "Data Source=localhost;Initial Catalog=pubs;Integrated Security=True;User ID =sa;Password =sa";
using (SqlConnection myConnection = new SqlConnection(strCon))
{
myConnection.Open();
SqlDataAdapter Adapter = new SqlDataAdapter("select * from authors", myConnection);
DataSet myDs = new DataSet();
Adapter.Fill(myDs);
DataTable myTable = myDs.Tables[0]; }
}
}
}