10-C.._241_266_.Z

Similar documents
TOEIC

tkk0408nari

K227 Java 2

スライド 1

MVP for VB が語る C# 入門

ALG ppt

untitled

With sqlda sqlda に SelectCommand を追加.SelectCommand = New MySqlCommand() With.SelectCommand.CommandType = CommandType.Text.CommandText = "select * from

Microsoft認定資格問題集(70-483_demo)

Java演習(4) -- 変数と型 --

...Visual Studio 2015\Projects\MyHomePage 用サンプル \Database(Access2)\Database(Access2)\MainForm.cs 2 れを含めておかないと Database への更新がきかない oadp.fill(dtbl); dgvk

d_appendixB-asp10appdev.indd

Case 0 sqlcmdi.parameters("?tencode").value = Iidata(0) sqlcmdi.parameters("?tenname").value = Iidata(1) 内容を追加します sqlcmdi.executenonquery() Case Else

新・明解Java入門

1 ex01.sql ex01.sql ; user_id from (select user_id ;) user_id * select select (3+4)*7, SIN(PI()/2) ; (1) select < > from < > ; :, * user_id user_name

mySQLの利用

ADO.NETのアーキテクチャ

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略   

解きながら学ぶJava入門編

D:\Documents\Visual Studio 2015\Projects\MyHomePage 用サンプル \ExcelAndWord\ExcelAndWord\MainForm.cs 1 /* */ Excel や Word とやりとりする ~9,20 仕様 Excel

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

Prog2_15th

アルゴリズムとデータ構造1

ストラドプロシージャの呼び出し方

Prog2_12th

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

TopLink å SampleClient.java... 5 Ò readallsample() querysample() cachesample() Ç..

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

WinHPC ppt

FileMaker ODBC and JDBC Guide

Visual Studio2008 C# で JAN13 バーコードイメージを作成 xbase 言語をご利用の現場でバーコードの出力が必要なことが多々あります xbase 言語製品によっては 標準でバーコード描画機能が付加されているものもあるようで す C# では バーコードフォントを利用したりバー

解きながら学ぶC++入門編

C++ → C#

ii II Web Web HTML CSS PHP MySQL Web Web CSS JavaScript Web SQL Web

Q&A集

ALG ppt

haskell.gby

1,.,,,., RDBM, SQL. OSS,, SQL,,.

untitled

Oracle Lite Tutorial

,, create table drop table alter table

Windows Web Windows Windows WinSock

2016 VOCALOID Group, Yamaha Corporation 2


1 SQL Server SQL Oracle SQL SQL* Plus PL/SQL 2 SQL Server SQL Server SQL Oracle SQL SQL*Plus SQL Server GUI 1-1 osql 1-1 Transact- SQL SELECTFROM 058

DEMO1 まずはやってみよう アクティビティをダブルクリック 作成 - プロジェクト C# => Workflow CodeActivity をぽとぺ シーケンシャルと ステートマシン それぞれのコ ンソールアプリ あとライブラリがある びっくりマークは足りていないあかし プロパティをみると判別で

052-XML04/fiÁ1-part3-’ÓŠ¹

Microsoft Word - Android_SQLite講座_画面800×1280

明解Javaによるアルゴリズムとデータ構造

fp.gby


Windowsユーザーの為のOracle Database セキュリティ入門

Java updated

DAOの利用

ファイル操作

1_cover

: : : TSTank 2

C# の現在・過去・未来

ALG ppt

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

Abstract Kinect for Windows RGB Kinect for Windows v Kinect for Windows v2

r08.dvi

226

Copyright c 2008 Zhenjiang Hu, All Right Reserved.

VB 資料 電脳梁山泊烏賊塾 音声認識 System.Speech の利用 System.Speech に依るディクテーション ( 音声を文字列化 ).NetFramework3.0 以上 (Visual Studio 2010 以降 ) では 標準で System.Speech が用意されて居るの

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略   

ohp08.dvi

スライド 1

データを TreeView コントロールで表示 VisualStudio2017 の Web サイトプロジェクトで bootstrap, 及び script フォルダの js ファイルが使用できるマスターページを親とする TestTreeView.aspx ページを作成します 下記の html コー

Copyright c 2006 Zhenjiang Hu, All Right Reserved.

3 Powered by mod_perl, Apache & MySQL use Item; my $item = Item->new( id => 1, name => ' ', price => 1200,

FileMaker 16 ODBC と JDBC ガイド

6-1

パターン化されたロジックのコンポーネント化

FileMaker 15 ODBC と JDBC ガイド

r07.dvi

オブジェクト指向プログラミング・同演習 5月21日演習課題

ohp07.dvi

1: Preference Display 1 package sample. pref ; 2 3 import android. app. Activity ; 4 import android. content. Intent ; 5 import android. content. Shar

untitled

PowerCOBOL ユーザーズガイド

untitled

Windows (L): D:\jyugyou\ D:\jyugyou\ D:\jyugyou\ (N): en2 OK 2

Oracle Lite Tutorial

PowerPoint プレゼンテーション

Oracle Forms Services R6i

00vb10-CONT-deitel.indd

KL-V450 Printer Driver

Microsoft PowerPoint - db03-5.ppt

I java A

Oracle Lite Tutorial

A, K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3,


新版明解C言語 実践編

MPI MPI MPI.NET C# MPI Version2

presen.gby

Condition DAQ condition condition 2 3 XML key value

.NET Framework 4.0 世代の Expression Trees

FileMaker ODBC and JDBC Guide

JavaScript の使い方

Transcription:

Windows 10 1 2 3 4 5 Visual Studio 2008LINQ MySchedule

242 Microsoft Visual C# 2008

10 Windows 243 1 LINQIEnumerableXML LINQ to Object q Form1.cs w RefreshListBox private void RefreshListBox() schedulelistbox.items.clear(); if (listitem.shortflg) label5.text = ""; var sortshortitems = from shorttable in listitem.getcurrentshortitems(startdate) orderby shorttable.startdatetime, shorttable.enddatetime select shorttable; foreach (ShortItem s in sortshortitems) schedulelistbox.items.add(s.itemall); else label5.text = ""; var sortlongitems = from longtable in listitem.getcurrentlongitems(startdate) orderby longtable.startdatetime, longtable.enddatetime select longtable; foreach (LongItem l in sortlongitems) schedulelistbox.items.add(l.itemall); //

244 Microsoft Visual C# 2008 e MainForm r inputbutton_click t inputbutton_click RefreshListBox w //Click private void inputbutton_click(object sender, EventArgs e) // if (subjecttextbox.text!= "" && contenttextbox.text!= "") // // if (starttextbox.text == endtextbox.text) listitem.shortflg = true; shortmenu.checked = true; longmenu.checked = false; label5.text = ""; ShortItem shortitem = new ShortItem(startTextBox.Text, starttimedomainupdown.text, endtimedomainupdown.text, subject, contents); if (listitem.addshortitems(shortitem)) schedulelistbox.items.clear(); var sortshortitems = from shorttable in listitem.getcurrentshortitems(startdate) orderby shorttable.startdatetime, shorttable.enddatetime select shorttable; foreach (ShortItem shorts in sortshortitems) schedulelistbox.items.add(shorts.itemall); else MessageBox.Show("", ""); // else listitem.shortflg = false; shortmenu.checked = false; longmenu.checked = true; label5.text = ""; LongItem longitem = new LongItem(startTextBox.Text, endtextbox.text, subject, contents); if (listitem.addlongitems(longitem))

10 Windows 245 schedulelistbox.items.clear(); var sortlongitems = from longtable in listitem.getcurrentlongitems(startdate) orderby longtable.startdatetime, longtable.enddatetime select longtable; foreach (LongItem longs in sortlongitems) schedulelistbox.items.add(longs.itemall); else MessageBox.Show("", ""); ClearSubject(); // else MessageBox.Show("", ""); y u i 13:0013:30 test2 o 10:0013:00 test1 test1test2

246 Microsoft Visual C# 2008!0!1!2 test1 13:3014:30 OK test2test1

10 Windows 247 var sortshortitems = from shorttable in listitem.getcurrentshortitems(startdate) orderby shorttable.startdatetime, shorttable.enddatetime select shorttable; LINQ sortshortitems var sortshortitemsienumerable<shortitem> sortshortitems LINQ var = from in where orderby select foreach (ShortItem s in sortshortitems) schedulelistbox.items.add(s.itemall); foreachz var sortlongitems = from longtable in listitem.getcurrentlongitems(startdate) orderby longtable.startdatetime, longtable.enddatetime select longtable; sortlongitems foreach (LongItem l in sortlongitems) schedulelistbox.items.add(l.itemall); foreachc

248 Microsoft Visual C# 2008 2 myinit.txt LINQ to SQLLINQ to SQLSQL Server myinit.txt q myinit.txtuse=database DISP=SHORT SHORT=shortfile.csv LONG=longfile.csv HELP=myschedule.chm USE=DATABASE w FileIO.cs e FileIOInitRead class FileIO public static string shortfile; public static string longfile; public static string myhelp; public static bool databaseflg = false; // public static void InitRead(ScheduleList list) if (File.Exists("myinit.txt")) try StreamReader reader = new StreamReader("myinit.txt", Encoding.GetEncoding("Shift_JIS")); while(reader.peek()!= -1) string[] field=reader.readline().split('='); if (field[0] == "DISP") if (field[1] == "SHORT") list.shortflg = true; else list.shortflg = false;

10 Windows 249 // if (field[0] == "USE") databaseflg = true; shortfile = null; longfile = null; if (field[0] == "SHORT") shortfile=field[1]; if (field[0] == "LONG") longfile = field[1]; if (field[0] == "HELP") myhelp = field[1]; reader.close(); catch (FileNotFoundException) // r MySchedule t y MySchedule

250 Microsoft Visual C# 2008 u MySchedule.mdf i MySchedule.mdf o!0 Null Null STARTDATE char(10) STARTTIME char(5) ENDTIME char(5) SUBJECT nchar(20) CONTENTS nvarchar(50)!1 SHORTTABLE!2 LONGTABLE Null STARTDATE char(10) ENDDATE char(10) SUBJECT nchar(20) CONTENTS nvarchar(50)!3 LONGTABLESHORTTABLE

10 Windows 251 public static bool databaseflg = false; databaseflgfalse if (field[0] == "USE") databaseflg = true; shortfile = null; longfile = null; field0usedatabaseflgtrue shortfilelongfilenull Table ColumnLINQ to SQL SQL q MySchedule w LINQ to SQL e ScheduleSQL ScheduleSQL.dbml

252 Microsoft Visual C# 2008 r LONGTABLE SHORTTABLEScheduleSQL.dbml DataContext t r LINQ to SQL q FileIO.cs w FileIORead // public static void FileIORead(ScheduleList list) // try // if(shortfile!=null) // // if(longfile!=null) // // if (databaseflg) var db = new ScheduleSQLDataContext();

10 Windows 253 var shorttable = from sfield in db.shorttable select sfield; foreach (var sfield in shorttable) ShortItem s = new ShortItem(sfield.STARTDATE, sfield.starttime, sfield.endtime, sfield.subject, sfield.contents); list.addshortitems(s); var longtable = from lfield in db.longtable select lfield; foreach (var lfield in longtable) LongItem l = new LongItem(lfield.STARTDATE, lfield.enddate, lfield.subject, lfield.contents); list.addlongitems(l); catch (FileNotFoundException) // e FileIOWrite using System.Data.Sqlclient; // // public static void FileIOWrite(ScheduleList list) try // // // // // if (databaseflg) string basedir = AppDomain.CurrentDomain.BaseDirectory; string ConnectionString = "Data Source=. SQLEXPRESS;AttachDbFilename= "" + basedir + "MySchedule.mdf ";Integrated Security=True;User Instance=True"; SqlConnection hconnection = ( new SqlConnection(ConnectionString)); hconnection.open(); // string SQL = "DELETE FROM SHORTTABLE"; SqlCommand cmd = new SqlCommand(SQL, hconnection); cmd.executenonquery(); // SQL = "DELETE FROM LONGTABLE";

254 Microsoft Visual C# 2008 cmd = new SqlCommand(SQL, hconnection); cmd.executenonquery(); // foreach (ShortItem s in list.shortitems) string[] field = s.getfield(); SQL = "INSERT INTO SHORTTABLE VALUES('" + field[0] + "'," + "'" + field[1] + "','" + field[2] + "','" + s.subject + "','" +s.contents + "')"; cmd = new SqlCommand(SQL, hconnection); cmd.executenonquery(); // foreach (LongItem l in list.longitems) string[] field = l.getfield(); SQL = "INSERT INTO LONGTABLE VALUES('" + field[0] + "','" + field[1] + "','" + l.subject + "','" + l.contents + "')"; cmd = new SqlCommand(SQL, hconnection); cmd.executenonquery(); hconnection.close(); hconnection.dispose(); catch (FileNotFoundException) // r InitWrite // public static void InitWrite(ScheduleList list) try string[] files = new string[3]; // StreamReader reader = new StreamReader("myinit.txt", Encoding.GetEncoding("Shift_JIS")); while (reader.peek()!= -1) string[] field = reader.readline().split('='); if(field[0] == "SHORT") files[0] = field[1]; if (field[0] == "LONG") files[1] = field[1]; if (field[0] == "HELP") files[2] = field[1]; reader.close(); // StreamWriter writer = new StreamWriter("myinit.txt", false,

10 Windows 255 Encoding.GetEncoding("Shift_JIS")); if(list.shortflg) writer.writeline("disp=short"); else writer.writeline("disp=long"); if (files[0]!= null) writer.writeline("short=" + files[0]); if (files[1]!= null) writer.writeline("long=" + files[1]); if (files[2]!= null) writer.writeline("help=" + files[2]); if(databaseflg) writer.writeline("use=database"); writer.close(); catch (FileNotFoundException) // var db = new ScheduleSQLDataContext(); ScheduleSQLDataContextDataContext ScheduleSQLDataContext var shorttable = from sfield in db.shorttable select sfield; SHORTTABLEshorttable foreach (var sfield in shorttable) ShortItem s = new ShortItem(sfield.STARTDATE, sfield.starttime,sfield.endtime, sfield.subject, sfield.contents); list.addshortitems(s); x1 var longtable = from lfield in db.longtable select lfield; LONGTABLElongtable

256 Microsoft Visual C# 2008 foreach (var lfield in longtable) LongItem l = new LongItem(lfield.STARTDATE, lfield.enddate, lfield.subject, lfield.contents); list.addlongitems(l); v1 string basedir = AppDomain.CurrentDomain.BaseDirectory; string ConnectionString = "Data Source=. SQLEXPRESS;AttachDbFilename= "" + basedir + "MySchedule.mdf ";Integrated Security=True;User Instance=True"; basedir ConnectionString SqlConnection hconnection = ( new SqlConnection(ConnectionString)); SqlConnection hconnection.open(); SqlCommand cmd = new SqlCommand(SQL, hconnection); SQLSQL SQLcmd cmd.executenonquery();.sql foreach (ShortItem s in list.shortitems) string[] field = s.getfield(); SQL = "INSERT INTO SHORTTABLE VALUES('" + field[0] +"'," + "'" + field[1] + "','" + field[2] + "','" + s.subject + "','" + s.contents + "')"; cmd = new SqlCommand(SQL, hconnection); cmd.executenonquery(); 1

10 Windows 257 hconnection.close(); hconnection.dispose(); StreamReader reader = new StreamReader("myinit.txt", Encoding.GetEncoding("Shift_JIS")); myinit.txt null if (files[0]!= null) writer.writeline("short=" + files[0]); if (files[1]!= null) writer.writeline("long=" + files[1]); if (files[2]!= null) writer.writeline("help=" + files[2]); if(databaseflg) writer.writeline("use=database"); stringfiles012 trueuse=database

258 Microsoft Visual C# 2008 3 MySchedule MySchedule q w MySchedule e r Visual C# t Icon1.ico y Icon1.ico

10 Windows 259 u Icon1.ico161632322 32321616 1616 3232 q 32324BMP 3232 w 16164BMP 1616 e Icon1.ico

260 Microsoft Visual C# 2008 MyScheduleIcon1.ico MySchedule.exe q MySchedule w Icon1.ico e Icon1.ico r t MySchedule bin Debug MySchedule.exeIcon1.ico w t

10 Windows 261 MySchedule Icon1.ico q MainForm MainForm w Icon... e Icon1.icoMySchedule Icon r DisplayForm UpdateFormIcon t MainForm y d

262 Microsoft Visual C# 2008 4 VersionForm q MySchedule w e r Bitmap1.bmp t Bitmap1.bmp y u Bitmap1.bmp

10 Windows 263 VersionFormBitmap1.bmp q VersionForm w PictureBox picturebox1 e Image... r t y Bitmap1.bmp MySchedule u OK PictureBoxBitmap1.bmp

264 Microsoft Visual C# 2008 i SizeModeAutoSize PictureBox o!0!1!2 PictureBox r

10 Windows 265 5 MySchedule MyScheduleMySchedule bin DebugMySchedule.exe MySchedule q DebugRelease w Release e MySchedule MySchedule bin Release MySchedule.exe

1 Visual Studio 2008 15 C var var x = 1; var y = 1.0; var z = "abcde"; zx1int x1.064double cabcdestring static class Extensions public static string IndexString(this string s) string str = "Hello C#"; string s1 = str.indexstring(); zindexstringthis xzindexstringextensions. IndexString(str)

16 Microsoft Visual C# 2008 Func<int, bool> result = n => n > 0; MessageBox.Show(result(-1) + ""); z0true0false xz1false LINQ var = newnew=1,="", new=2,="", new=3,="", ; var = from p in where p.==2 select p.; foreach (var in ) MessageBox.Show();

1 Visual Studio 2008 17 z x 2 c public int number get; set; number=12345; MessageBox.Show(number+""); znumber xnumber12345 cnumber

186 Microsoft Visual C# 2008 C StringDateTime.NET Framework ConsoleMath Console Math Random Console ReadLine WriteLine 1 Math Abs Ceiling Floor Max Min PI Pow Sign Sqrt 2 2 12-1100

7 187 Random Random Next 0 DirectoryFile StreamReaderStreamWriter 8 Directory CreateDirectory Delete GetDirectories GetFiles Move 12 File Copy Create Delete Exists Move 12 12

188 Microsoft Visual C# 2008 System.TextEncodingUnicode System.Collections ArrayList HashTable System.DrawingGDI+ System.Drawing.Drawing2DSystem.Drawing.ImagingSystem.Drawing.Text System.Windows.FormsMicrosoft Windows Windows