名單上有它連接到一個數據庫,並打印出所有行返回即一些基本的C#代碼: using (connection = new SqlConnection(ConfigurationManager.AppSettings["connString"]))
{
using (command = new SqlCommand("select * from table1", connection))
我現在所擁有的是這樣的: Dim users = From users In tempTable _
Distinct Select users.Item("s_userid")
Dim usersCount As Integer = users.Count
但我敢肯定,我不應該這樣做。我應該能夠從第一個linq查詢中獲取/計數。我錯過了什麼?
我有以下類型的代碼: String strGroup = Request.QueryString["group"];
switch(strGroup.ToString){
case "Clients":
// do something here
break;
case "Addresses":
// do something here