質問編集履歴
1
質問が重複しましたので修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,63 +1,5 @@
|
|
1
|
-
|
1
|
+
重複質問でした
|
2
2
|
|
3
|
-
|
3
|
+
ひとつ前の質問で解決したような内容を質問しておりました。
|
4
4
|
|
5
|
-
Microsoft SQL Server 2014 - 12.0.2269.0 (X64)
|
6
|
-
|
7
|
-
Jun 10 2015 03:35:45
|
8
|
-
|
9
|
-
Copyright (c) Microsoft Corporation
|
10
|
-
|
11
|
-
Express Edition (64-bit) on Windows NT 6.3 <X64> (Build 17763: )
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
![イメージ説明](70acb33b68934cb4edca1981c32494de.jpeg)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
この画面のDataGridViewに下記のデータベースを表示させたいです。
|
20
|
-
|
21
|
-
![イメージ説明](86a566ee2ccbc85716cc2b94946c0374.jpeg)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
今現在Form1のイベントハンドラに
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
5
|
+
修正いたします
|
30
|
-
|
31
|
-
//GetConnectionString1()は接続文字列
|
32
|
-
|
33
|
-
var connectionString = GetConnectionString1();
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
var connection = new SqlConnection(connectionString);
|
38
|
-
|
39
|
-
connection.Open();
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
var command = new SqlCommand();
|
44
|
-
|
45
|
-
command.Connection = connection;
|
46
|
-
|
47
|
-
command.CommandText = @"SELECT * from orders_detail ";
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
var reader = command.ExecuteReader();
|
52
|
-
|
53
|
-
dataGridView1.DataSource = reader;
|
54
|
-
|
55
|
-
connection.Close();
|
56
|
-
|
57
|
-
```
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
のコードを書き込んでおります。
|
62
|
-
|
63
|
-
お手数ですがDataGridViewにデータベースを出力する際のほうほうあればご教示お願いいたします
|