首页 > 代码库 > 简单的sql server连接

简单的sql server连接

private void sqlconn(string time)

    {
        SqlConnection conn = new SqlConnection("SERVER=.;DATABASE=pubs;PWD=;UID=sa;");
        SqlCommand cmd = new SqlCommand("SELECT*FROM [table]‘", conn);
        DataSet ds = new DataSet();
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        adp.Fill(ds);
    }

 

简单的sql server连接