LoginSignup
1
2

More than 5 years have passed since last update.

c#

Last updated at Posted at 2014-10-27

レコードをコンボボックスに抽出
http://vb.xn--netde-rm4dun6em173aog4b.com/39.htm

DBアプリ作成
http://www.atmarkit.co.jp/ait/subtop/features/dotnet/app/vsdbprog_index.html

これが参考になる
http://blog.hiros-dot.net/?p=4844

/* コンポーネント*/
データベースへ接続確認

        SqlConnection sqlcon = new SqlConnection("Data Source=KONGOU\\LEARN01;Integrated Security=True;Initial Catalog=mori;");
        //  SqlCommand sqlcmd = new SqlCommand("DELETE FROM Qualification WHERE QUALIFICATION1 ", sqlcon);

        // データベース接続を開く
        sqlcon.Open();

        // 接続に成功した旨を表示する
        MessageBox.Show("DBに接続されました");

        // データベース接続を閉じる (正しくは オブジェクトの破棄を保証する を参照)
        sqlcon.Close();
        sqlcon.Dispose();

使用頻度高いメソッド

画面を閉じる

this.Close();

C#入門
http://ufcpp.net/study/csharp/#index-start

コンボボックスの値を取得するには
nameに対してキャストする必要がある
((DataRowView)comboBox1.SelectedItem).Row["QUALIFICATION1"].ToString();

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2