0
我在SQL查詢中遇到了一些問題。我嘗試在其他select查詢中使用select結果來獲取結果,但它不工作。任何人都可以指導我。下面是我在WCF中使用的代碼。非常感謝你。SQL Select語句無法正常工作
SqlCommand command = new SqlCommand("select tName from dbo.tblBankBranch where nBankID=(select nID from dbo.tblBankBranch where tState='" + tBank + "')", con);
SqlDataReader reader = command.ExecuteReader();
實際問題是什麼。你能解釋「不工作」嗎?它拋出異常嗎?它什麼都沒有返回? –
它不會返回任何錯誤。 –
你怎麼知道它返回了什麼?您發佈的代碼不會查看'SqlDataReader' –