Azureのデータ取得の部分でエラーが出ます
C#
1 using (var connection = new SqlConnection("接続文字列")) 2 { 3 connection.Open(); 4 StringBuilder sb = new StringBuilder(); 5 6 sb.Append("SELECT * "); 7 sb.Append("FROM [データ名].[dbo].[Table] "); 8 String sql = sb.ToString(); 9 10 using (SqlCommand command = new SqlCommand(sql, connection)) 11 { 12 using (SqlDataReader reader = command.ExecuteReader()) ← ここでエラー 13 { 14 ・・・・・・・ 15 } 16 } 17 }``` 18 19 20エラー文 21System.Data.SqlClient.SqlException: 'Incorrect syntax near the keyword 'Table'.' 22 23 24SQL文は、「SELECT*[データ名].[dbo].[Table]」となっています。 25 26 27 28よろしくお願いします
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/04/24 14:49
2017/04/24 15:33