111,092
社区成员




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]; }
}
}
}