2010-08-20 36 views

回答

0

使用SqlDataAdapter來填充數據集是這樣的:

SqlConnection conn = new SqlConnection(connection); 
SqlDataAdapter adapter = new SqlDataAdapter(); 
adapter.SelectCommand = new SqlCommand("exec spSomeStoredProc", conn); 
adapter.Fill(dataset); 

// dataset.Tables[0] - refers to resultset obtained from first SQL query 
// in stored procedure. dataset.Tables[1] - refers to resultset obtained 
// from second SQL query. Etc. 

如果它必須做異步看看下面的文章,顯示如何異步拉回到一個DataSet中的代碼。

Asynchronous DataSet

相關問題