お世話になっております。
一覧データを取得し表示する部分のSQLなのですが、
長いので改行をしたいですが
何行かに分けて書くことは可能でしょうか。
よろしくお願い致します。
C#
1using System; 2using System.Collections.Generic; 3using System.ComponentModel; 4using System.Data; 5using System.Drawing; 6using System.Linq; 7using System.Text; 8using System.Threading.Tasks; 9using System.Windows.Forms; 10using System.Data.SQLite; 11 12namespace 基幹システム.株式関係 13{ 14 public partial class kabu : Form 15 { 16 public kabu() 17 { 18 InitializeComponent(); 19 } 20 21 private void kabu_Load(object sender, EventArgs e) 22 { 23 //DB接続等 24 string dbPath = Application.StartupPath + @"\kabukanri.db"; 25 using (SQLiteConnection con = new SQLiteConnection("Data Source=" + dbPath)) 26 { 27 DataTable datatable = new DataTable(); 28 29 SQLiteDataAdapter adapter = new SQLiteDataAdapter("select 損益テーブル.日付 || (曜日テーブル.曜日) as 日付,損益テーブル.損益額,コメントテーブル.コメント from 損益テーブル left join コメントテーブル on 損益テーブル.日付 = コメントテーブル.日付 left join 曜日テーブル on 損益テーブル.曜日ID = 曜日テーブル.ID; ", con); 30 adapter.Fill(datatable); 31 32 this.dataGridView1.DataSource = datatable; 33 34 //ヘッダーを変更 35 dataGridView1.Columns[0].HeaderText = "日付"; 36 dataGridView1.Columns[1].HeaderText = "損益額"; 37 dataGridView1.Columns[2].HeaderText = "コメント"; 38 39 40 } 41 } 42 } 43} 44
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/04/13 07:40
2017/04/13 08:06