içindekiler

Transkript

içindekiler
İÇİNDEKİLER
VII
İÇİNDEKİLER
1 VISUAL STUDIO MENÜLERİ VE EKRAN GÖRSELLERİ 1
C# Nedir? 1
.NET Framework 1
Visual Studio Programını Başlatmak 2
Start Page (Başlangıç Sayfası) 3
File Menüsü (Dosya) New Project (Yeni Bir Proje Başlatmak) 5
5
Open Folder in File Explorer (Projenin Klasör Yolunun Açılması) 7
Build Solution (Projeleri Derlemek) 7
Open Project (Varolan Projeleri Açmak) 10
Add New Project, Close and Close Solution 11
Save All (Projenin Tümünü Kaydetmek) 11
Recent Project and Solutions, Yazıcıda Kod Satır Numaralarını Görmek 12
Edit Menüsü (Düzen) 12
Undo Redo (Geri Sar, İleri Sar) 12
Cut (Keserek Kopyala), Copy (Kopyala), Paste (Yapıştır), Delete (Sil) 13
Find and Replace (Bul ve Değiştir) 13
Cycle Clipboard Ring, Mouse Sürükle Bırak 14
Advanced 15
Intellisense 15
Intellisense Pascal Case Generate Method, Organize Usings Remove Unused Usings/Kullanılmayan Using ifadeleri View Menüsü (Görünüm) 16
16
17
17
Code 17
Designer, Architecture Explorer 18
Code Definition Window 19
Object Browser, Error List 20
Start Page, Property Pages 21
C#_ile_Projeler_ICINDEKILER.indd 7
26.12.2013 16:28
VIII
PROJELER İLE C# VE SQL SERVER
Toolbox 22
Toolbox En Çok Kullanılan Kontrolleri Gruplandırma 24
Toolbox Penceresinden Forma Kontrol Sürükleme 24
Properties Window Properties Penceresi İkonları, Solution Explorer 25
26
Project Menüsü 29
Build Menüsü 31
Debug Mod ile Release Mod Farkı, Projenin EXE Hali Tools Menüsü Code Snippets Manager Visual Studio Ayarlarını Yedeklemek (Import and Settings Wizard) 33
33
34
35
Customize (Menülerin Düzenlenmesi) 37
Kendi Menümüzü Hazırlamak, Options 38
Environment 39
General, Fonts and Colors Project and Solution Text Editor, General Window Menüsü 39
40
40
44
Float 44
Pin Tab,Auto Hide,New Horizontal/Vertical Tab Group, Reset Window 45
Windows 45
Pencereleri Sürükleme 46
Bir Kod Bloğunda Sütun Seçmek 47
Alt Tuşu İle Kullanılan Harfler 48
Debug Menüsü Projeyi Çalıştırmak 49
49
F5 49
Ctrl+F5, Shıft+F5, Toggle Breakpoint, Step, Step Over Step Into, Step Out, QuickWatch 50
51
Proje Çalıştırmak ve Kodları Debug Etmek 51
Pencereler (Windows) 52
C#_ile_Projeler_ICINDEKILER.indd 8
26.12.2013 16:28
İÇİNDEKİLER
Advanced, Intellisense, Snippets 53
Refactor, Edit 54
F Tuşları 55
Diğer Ctrl Tuşları, Resolve 56
2 PROJE GELİŞTİRMEK, FORM PROPERTIES VE EVENTS 57
İlk Form Uygulaması, Design, Form Özellikleri (Properties) 57
Form Appearance Properties: IX
59
BackColor 59
ForeColor, FormBorderStyle 60
BackgroundImage, BackgroundImageLayout 61
Font, RightToLeft 63
Text 64
Form Behavior Properties AllowDrop, ContextMenuStrip, DoubleBuffered 64
64
Enabled 65
Form Data, DataBindings, Tag 65
Form Design 65
Name Özelliği, Language, Localizable, Locked 65
Form Focus, CausesValidation 66
Form Layout 66
AutoScroll, AutoSize, AutoSizeMode 66
MaximumSize 66
MinimumSize, Padding, Size, StartPosition, WindowState 67
Form Misc, AcceptButton 67
Form Window Style 68
CancelButton, HelpButton, Icon, MainMenuStrip 68
MaximizeBox, MinimizeBox 68
Opacity, ShowIcon, ShowinTaskbar, SizeGripStyle, TopMost 69
Events (Olaylar) Action Events Click, MouseClick, DoubleClick, MouseDoubleClick C#_ile_Projeler_ICINDEKILER.indd 9
69
71
71
26.12.2013 16:29
X
PROJELER İLE C# VE SQL SERVER
Scroll 72
Behavior (Davranış) 72
ControlAdded, ControlRemoved, FormClosed, FormClosing 72
FormLoad, Shown 72
DragDrop 73
DragDrop, DragEnter, DragOver Olay Parametreleri 73
73
EventArgs 73
Sender 74
Kod Yazım Kuralları 75
Windows Form Application ve Kod Yazmak 76
Proje: Windows Form Application 76
Proje: Form Properties ve Inıtializer 79
Proje: Form Load, Click Olayı ve Properties 88
NameSpace Keywords 95
NameSpace 95
Using ve References IDisposable, Nokta Operatörü, :: İki Nokta Operatörü Access Modifiers (Erişim Belirteçleri) 97
98
99
Private (Özel), Public (Genel), Protected (Korumalı), Internal (Dâhili) 99
Protected Internal (Dâhili Korumalı) 99
Assembly 99
Class Hakkında Genel Bilgiler 100
Partial Class, Sealed Class, Abstract Class, Static Class 101
Instance, Inheritance 101
Region 102
Varsayılan Kontrol Olayları 103
Proje: Form ControlAdded ve Remove Olayı 104
Proje: Form MouseClick ve MouseDoubleClick Olayı 112
Proje: Form Closed ve Closing Olayı 117
Proje: Form Shown Olayı 123
Proje: Form DragEnter Olayı 127
C#_ile_Projeler_ICINDEKILER.indd 10
26.12.2013 16:29
İÇİNDEKİLER
3 DEĞİŞKENLER, VERİ TİPLERİ VE OPERATÖRLER Variables (Değişkenler), Veri Tipleri 133
133
Değer Tipleri, Sayısal Veri Tipleri, Sayısal Ondalık Veri Tipleri 134
Karakter Veri Tipi, Mantıksal Veri Tipi, Tarih Veri Tipi 135
Referans Tipleri, Object Veri Tipi 135
String Veri Tipi Bit Hesaplama 135
Var Otomatik Tip Algılayıcısı 136
Proje: Veri Tipleri ve Boyut Hesaplama 136
Değişken Adlandırma Kuralları 144
Değişken Adlandırma Standartları 145
Camel Case, Pascal Case, UpperCase 145
Değişkenlerde Ömür 146
Global Değişkenler, Local Değişkenler 146
Scope (Kapsam) Kavramı 146
Class Scope 146
Block Scope 147
Proje: Global ve Local Değişkenler 147
Bellekteki Yerlerine Göre Değişkenler 151
Stack, Heap 152
Boxing ve Unboxing XI
152
Operatörler 153
Aritmetik Operatörler, Atama Operatörleri 153
Mantıksal Operatörler, Karşılaştırma Operatörleri 154
Diğer Operatörler ve Semboller, İşlem Önceliği 155
Proje: Operatörler 4 TİP DÖNÜŞÜMLERİ VE DEĞİŞKEN TİPLERİNİ ANLAMAK Değişkenlerin Tip Dönüşümleri Casting Yöntemi 156
165
165
166
Implicit (Bilinçsiz) Tür Dönüşümü 166
Explicit (Bilinçli) Dönüşümler 167
Convert Yöntemi C#_ile_Projeler_ICINDEKILER.indd 11
168
26.12.2013 16:29
XII
PROJELER İLE C# VE SQL SERVER
String Türü Dönüşümler 169
Parse Yöntemi, Döndürdüğü Hatalar: 170
TryParse 170
As İfadesi ile Tip Çevirimi Proje: TipDonusumleri Değişken Tiplerini Anlamak GetType() Değişken Tiplerini Anlamak, TypeOf() veya is Kullanımı Proje: GetType, TypeOf ve is 5 MESSAGEBOX SINIFI Mesaj Kutusu 170
171
179
180
180
185
185
Mesaj Kutusu Butonları 187
Mesaj Kutusu İkonları, DıalogResult 190
Proje: Mesaj Kutusu ve DialogResult 190
6 KONTROL DEYİMLERİ 205
If (Eğer) Else (Değilse) 205
If, Else If, Else Swıtch Case Proje: If Else - Switch 205
206
207
Ternary 216
Coalescing 216
Proje: Ternary, Coalescing 7 DÖNGÜLER 216
227
Döngüler 227
For Döngüsü 227
Proje: For Döngüsü ve Break 229
Proje: Forma ComboBox eklemek 231
Foreach Döngüsü Proje: Foreach Döngüsü While Döngüsü C#_ile_Projeler_ICINDEKILER.indd 12
234
235
239
26.12.2013 16:29
İÇİNDEKİLER
8 DİZİLER ARRAY 241
Diziler (Array) 241
Proje: Diziler (Array) 242
Collections (Koleksiyonlar) 252
ArrayList Class (Sınıfı) 253
Proje: ArrayList 253
ArrayList Özellikleri ve Metotları 256
Listeye Eleman Eklemek 257
XIII
Add Metodu, AddRange Metodu, Insert Metodu, InsertRange 257
Kapasite: Capacity Özelliği, TrimToSize Metodu 257
Eleman Sayısı: Count Özelliği 258
Temizleme/Silme İşlemleri 258
Clear, Remove Metodu , RemoveAt, RemoveRange Metodu Arama İşlemleri 258
258
Contains Metodu 258
IndexOf Metodu, LastIndexOf Metodu 259
Sıralama 259
Sort, Reverse Tip Çevirimleri ToArray Metodu, ToString Metodu HashTable Sınıfı Proje: HashTable Sınıfı 259
260
260
265
265
HashTable Özellikleri ve Metotları 269
Listeye Eleman Eklemek 269
Add Metodu 269
Temizleme/Silme İşlemleri 269
Clear Metodu, Remove 269
Kapasite 270
Eleman Sayısı, Count Özelliği Arama İşlemleri 270
270
Contains Metodu, ContainsKey Metodu, ContainsValue Metodu 270
C#_ile_Projeler_ICINDEKILER.indd 13
26.12.2013 16:29
XIV
PROJELER İLE C# VE SQL SERVER
Tip Çevirimleri ToString Metodu SortedList Sınıfı Proje: SortedList SortedList Özellikleri ve Metotları 271
271
272
272
275
GetKey Metodu, IndexOfKey 275
IndexOfValue, Queue, Stack 276
Proje: Queue and Stack Collection.Generic (Jenerik Koleksiyonlar) 276
285
Benzerlik Tablosu 286
Generic List Sınıfı 286
Generic List Özellikleri ve Metotları Listeye Eleman Eklemek Add, AddRange, Insert Metodu, InsertRange Metodu 286
287
287
Kapasite 287
Capacity Özelliği 287
TrimExcess Metodu 288
Eleman Sayısı: Count Özelliği 288
Temizleme/Silme İşlemleri 288
Clear, Remove, RemoveAt Metodu, RemoveRange Metodu Arama İşlemleri Contains Metodu, IndexOf Metodu, LastIndexOf Metodu 288
289
289
Sıralama 289
Sort, Reverse Tip Çevirimleri ToArray Metodu, ToString Metodu Proje: GenericList 289
290
290
290
Generic Dictionary 296
Generic Sorted List 299
Generic Queue, Generic Stack 300
Tuple 301
Proje: Tuple C#_ile_Projeler_ICINDEKILER.indd 14
301
26.12.2013 16:29
İÇİNDEKİLER
9 DİĞER VERİ TİPLERİ XV
305
Nullable 305
Nullable Tipler Metot ve Özellikleri: 305
Properties: Value, HasValue 305
Method: GetValueOrDefault 306
Guid 306
Proje: NullableGuıd 306
Struct 309
Enum 309
Proje: Struct ve Enum Enum Metotları GetName, GetNames, GetValues, Parse Metodu 310
315
315
10 REGEX CLASS 317
Regex Sınıfı 317
Karakterler 317
Özel Karakterler IsMatch Metodu 318
318
Mail Adresi Regex 320
Tarih Formatı Regex 321
Sadece Rakam Girişi İçin Regex, Harf ve Rakam Girişi İçin Regex 321
Proje: Regex 321
11 ENVIRONMENT INFORMATION APPLICATION RANDOM TIMER CLASS 327
Environment Class 327
Environment Özellikleri 327
Environment Metotları 328
Proje: Environment Property Method SpecialFolder SystemInformation Class Proje: SystemInformation Application Class Proje: Application Class, Sistemdeki Ondalık Ayracı Bulmak C#_ile_Projeler_ICINDEKILER.indd 15
328
335
335
339
344
26.12.2013 16:29
XVI
PROJELER İLE C# VE SQL SERVER
Random Class Kurucu (Constructor) Metodu Random Metotları 344
344
344
Next 344
NextBytes, NextDouble 345
Proje: Random 345
Timer Class Timer Kontrolü Özellikleri (Properties) Enabled, Interval 350
350
350
Tag 351
Timer Kontrolü Event: Tick 351
Timer Kontrolü Metotları: Dispose, Start, Stop, ToString 351
Proje: Timer Class 12 METOTLAR 352
361
Metotlar 361
Erişim Belirteçleri, Dönüş Değeri, Parametreler, Static Metotlar 362
Değer Döndürmeyen (void) Metotlar 363
Değer Döndüren Metotlar 367
Metotlarda Parametre 367
İsimlendirilmiş Parametreler Proje: Değer Döndüren ve Döndürmeyen Metot Kullanmak 368
368
Keys 378
Contsructor (Yapıcı Metot), Metotların Aşırı Yüklenmesi (Overloading) Proje: Overloading Olay Metotları Event Handler Proje: Olay Metotları Recursıve Metotlar Proje: Recursive Metot Tarih Biçimlendirme Summary (Metot Açıklamaları) C#_ile_Projeler_ICINDEKILER.indd 16
379
380
384
385
385
391
391
397
402
26.12.2013 16:29
İÇİNDEKİLER
Params (Parametrelere Birden Fazla Değer Göndermek) Proje: Params ve Summary 402
402
Metotlar ve Class Kavramı 411
Projeye Class Eklemek 411
Proje: Metotlar ve Class Kavramı 411
Metotlarda Out Parametresinin Kullanımı 419
Extension Methods 430
Class Library Projesi Başlatmak Dynamic Link Library Oluşturmak Proje: Extension Metotlar: MyExtension metodu. 431
431
433
IsCIft Metodu 434
IsNumerIc Metodu 435
Proje: Bir Projede DynamIc Link Library kullanmak 436
Projelere Referans Eklemek 437
Method Override 441
Proje: Method Override 13 STRING VE STRING BUILDER CLASSES, STOPWATCH CLASS String Sınıfı XVII
442
447
447
String Class Properties: Char Özelliği, Length Özelliği 448
String Class Methods 448
Kopyalama İşlemleri: Clone, Copy 448
Karşılaştırma: Compare 448
Birleştirme 449
Silme: Remove 451
Değiştirme: Replace 451
Parça Alma: SubString 452
Metin Bölme: Split 452
Ekleme: PadLeft 452
Ekleme: PadRight 453
Kırpma: Trim, TrimStart 453
Kırpma: TrimEnd 454
C#_ile_Projeler_ICINDEKILER.indd 17
26.12.2013 16:29
XVIII
PROJELER İLE C# VE SQL SERVER
Arama 454
Contains, StartsWith, EndWith, IndexOf 454
LastIndexOf 455
IndexOfAny, EndsWith Null Kontrolleri IsNullOrEmpty, IsNullOrWhiteSpace 456
457
457
Biçimlendirme: Format 458
Formatlama Belirteçleri 459
Rakamsal Formatlama Listesi, Tarihsel Formatlama Listesi Çevirim İşlemleri Karakterlerine Ayırma, ToCharArray Harf Çevirimleri ToLower, ToUpper, ToTitleCase (CultureInfo Class), ToString Proje: String Class Methods (TcCheck) StringBuilder Sınıfı Proje: StringBuilder 460
461
461
462
462
463
480
480
StopWatch 482
StringBuilder Properties Capacity, MaxCapacity 483
483
Length 484
StringBuilder Methods 484
Append, AppendLine, AppendFormat 484
Clear, CopyTo 484
EnsureCapacity 485
Equals 485
Insert, Remove, Replace 486
Proje: StringBuilder Metot ve Özellikleri 486
StopWatch Sınıfı StopWatch Özellikleri, Elapsed, ElapsedMilliseconds 492
492
IsRunning 492
StopWatch Metotları Reset, Restart, Start, StartNew, Stop C#_ile_Projeler_ICINDEKILER.indd 18
492
492
26.12.2013 16:29
İÇİNDEKİLER
14 MATH VE DATETIME CLASSES Math Class XIX
493
493
Metotları 493
Abs, BigMul, Ceiling, Floor, Log10 493
Max 494
Min, Pow, Round, Sqrt, Truncate DateTime Sınıfı, UTC DateTime Özellikleri 494
496
497
Today, Now, UtcNow, Date 497
Day, Month, Year, DayOfWeek, DayOfYear, TimeOfDay 498
Hour, Minute, Second 498
Millisecond 499
Kind 499
Proje: DateTime Properties 499
DateTime Metotları 501
Ekleme İşlemleri 501
Add 501
Proje: DateTimeMethods_Add Metodu 502
AddYears 502
AddMonths, AddDays, AddHours, AddMinutes 503
AddSeconds, AddMilliseconds 503
Tarih Farkını Bulmak: Subtract 503
Karşılaştırma 504
Compare 504
CompareTo, Equals Ayın Son Gününü Bulmak (DaysInMonth) 505
505
From 505
FromFileTime, FromFileTimeUtc 505
FromOADate, To, ToFileTime, ToFileTimeUtc, ToOADate 506
ToLocalTime, ToUniversalTime 507
ToLongDateString, ToLongTimeString, ToShortDateString 508
C#_ile_Projeler_ICINDEKILER.indd 19
26.12.2013 16:29
XX
PROJELER İLE C# VE SQL SERVER
ToShortTimeString, ToString 508
Is 508
IsDaylightSavingTime, IsLeapYear 508
Parse, Parse, TryParse 509
TimeSpan Struct TimeSpan Properties 510
511
Days, Hours, Milliseconds, Minutes, Seconds, Ticks, TotalDays 511
TotalHours, TotalSeconds, TotalMinutes, TotalMilliseconds 512
TimeSpan Methods 513
Ekleme, Add 513
Karşılaştırma 513
Compare, Equals, Çıkarma, Subtract 513
From 513
FromDays, FromHours, FromMinutes, FromSeconds 513
FromMilliseconds, FromTıcks 513
İşaretleme: Negate 514
Tip Çevirimleri: Parse, TryParse, ToString 514
15 HATA DENETİMİ 515
Try Catch Finally 515
Exception Class 516
Properties (Özellikler) HelpLink, Message, Source, StackTrace, TargetSite Methods (Metotlar) GetType, ToString 516
516
517
517
Proje: Try Catch Finally 517
Sadece Ondalık Sayıya İzin vermek 520
Other Exceptions Classes 523
ArgumentException, ArgumentNullException 523
DıvıdeByZeroException, FormatException 523
IndexOutOfRangeException, OverflowException, SqlException 524
Throw 524
C#_ile_Projeler_ICINDEKILER.indd 20
26.12.2013 16:29
İÇİNDEKİLER
Proje: Exception Yazım Hataları 524
535
Parantez Hataları 535
Büyük-Küçük Harf Hataları, Noktalama Hataları 536
RunTime Hataları XXI
538
ErrorProvider 538
Silinen Olay Metotları 539
Olay Metotlarını Resetlemek 540
Olay Metodunu Standart Dışı Adlandırmak 541
Bir Metodu Farklı Adlandırılmış Bir Olaya Bağlamak 16 DOSYA VE KLASÖR İŞLEMLERİ (SYSTEM.IO) 541
545
System.IO Kütüphanesi 545
IO NameSpace Classes 546
Directory Methods 546
Proje: System_IO Klasör Oluşturma İşlemleri 546
547
CreateDirectory 547
Exception Listesi 547
IOException, UnauthorızedAccessException 547
ArgumentException, ArgumentNullException 548
PathTooLongException, DirectoryNotFoundException 548
NotSupportedException 549
Klasör Silme İşlemleri: Delete 549
Klasörleri Listelemek 550
EnumerateDirectories 550
Klasör Var mı? Exists 551
Get İşlemleri 551
GetCreationTime, GetCreationTimeUTC 551
GetCurrentDirectory, GetDirectories 551
GetDirectoryRoot, GetFiles 552
GetFileSystemEntries, GetLastAccessTime 554
C#_ile_Projeler_ICINDEKILER.indd 21
26.12.2013 16:29
XXII
PROJELER İLE C# VE SQL SERVER
GetLastAccessTimeUTC, GetLastWriteTime 555
GetLastWriteTimeUtc, GetLogıcalDrives 555
GetParent 556
Set İşlemleri 556
SetCreationTime, SetCreationTimeUtc, SetCurrentDirectory 557
SetLastAccessTime, SetLastAccessTimeUtc 557
SetLastWriteTime, SetLastWriteTimeUtc 557
Taşıma: Move 557
DirectoryInfo Class 558
DirectoryInfo Özellikleri 558
Klasör Var mı? Exists 558
Klasörün Adı: Name 558
Üst Klasöre Ulaşım: Parent, Kök Dizin, Root 559
Proje: DirectoryInfo Class DirectoryInfo Metotları 559
561
Klasör Oluşturmak: Create, CreateSubDirectory, Klasör Silmek: Delete 561
Klasör Listelemek 561
EnumerateDirectories 561
EnumerateFiles, EnumerateFileSystemInfos, GetDirectories 562
GetFiles, GetFileSystemInfos 562
Klasör Taşımak: MoveTo 562
ToString 562
Proje: DirectoryInfo Metotları DriveInfo Class 563
574
Dosya Depolama Kapasiteleri 574
DriveInfo Özellikleri 575
Disk Boyutları: AvailableFreeSpace, TotalFreeSpace, TotalSize 575
Sürücü Format ve Tipleri: DriveFormat, DriveType 575
Disk Hazır mı? IsReady 575
Disk Adı, Etiketi: Name, RootDirectory, VolumeLabel 576
DriveInfo Metotları C#_ile_Projeler_ICINDEKILER.indd 22
576
26.12.2013 16:29
İÇİNDEKİLER
Tüm Diskleri Listelemek: GetDrives Proje: DriveInfo Class Path Class 576
576
581
Path Parametresi Klasör mü? 584
Dosya Uzantısını Değiştirmek: ChangeExtension 584
Klasör Yol Bilgisini Kombine Etmek: Combine 584
Get İşlemleri 585
GetDirectoryName, GetExtension, GetFileName 585
GetFileNameWithoutExtension, GetFullPath 585
GetInValidFileNameChars, GetInValidPathChars, GetPathRoot 586
GetRandomFileName, GetTempFileName, GetTempPath 586
Dosyanın Uzantısı Var mı? HasExtension 586
Klasörde Bir Kök Dizin Var mı? IsPathRooted 587
File Class XXIII
587
File Class Metotları Dosyaya Metin Ekleme İşlemleri UTF-8 Nedir? 588
588
588
AppendAllLines 588
AppendAllText, AppendText, WriteAllBytes, WriteAllLines Okuma İşlemleri ReadAllBytes, ReadAllLines, ReadAllText, ReadLines 589
589
590
Dosya Oluşturma İşlemleri: Create, CreateText 590
Dosya Kopyalama: Copy 590
Dosya Taşıma: Move 590
Dosyanın Silinmesi: Delete 590
Değiştirme İşlemleri: Replace 590
Şifreleme İşlemleri: Encrypt, Decrypt 591
Dosya Açmak: Open, OpenRead, OpenWrite, OpenText 591
Dosya var mı? Exists 591
Get İşlemleri 591
GetAccessControl 591
C#_ile_Projeler_ICINDEKILER.indd 23
26.12.2013 16:29
XXIV
PROJELER İLE C# VE SQL SERVER
GetAttributes, GetCreationTime, GetCreationTimeUtc 592
GetLastAccessTime, GetLastAccessTimeUtc 592
GetLastWriteTime, GetLastWriteTimeUtc 592
Set İşlemleri 592
SetAccessControl, SetAttributes, SetCreationTime 592
SetLastAccessTime, SetLastAccessTimeUtc, SetLastWriteTime 593
SetLastWriteTimeUtc 593
Proje: File Class - NoteWriteReadPrograming FileInfo Class FileInfo Properties Directory, DirectoryName, Name, Exists, IsReadOnly 593
604
604
605
Length 606
FileSystemInfo Class 606
Özellikler 606
Attributes 606
CreationTime, Extension, FullName, Name 607
LastAccessTime, LastWriteTime 607
Metotlar: Delete MemoryStream Class: Özellikleri CanRead, CanSeek, CanWrite, Capacity, Length 608
608
608
Position 609
StreamReader Class 610
StreamReader Özellikleri: CurrentEncoding, EndOfStream 610
StreamReader Metotları: Close, Read, ReadLine, Peek 610
StreamWriter 610
StreamWriter Özellikleri: Encoding, AutoFlush 610
StreamWriter Metotları 610
Close 610
Write, WriteLine Proje: NotePadLike 611
611
FileSystemWatcher 622
C#_ile_Projeler_ICINDEKILER.indd 24
26.12.2013 16:29
İÇİNDEKİLER
FileSystemWatcher Özellikleri EnableRaisingEvents, Filter, IncludeSubDirectories NotifyFilter, Path 622
622
623
Olayları: Changed, Created, Deleted, Renamed 623
Proje: Klasör Değişikliklerini Takip Etmek 623
WriteLineAsync (Asenkron) 17 XML XXV
627
629
XML 629
Proje: XML Sample - ReadXML 630
Root Element 630
Node Element, Child Element, XML Element, Inner Text 631
DataSet ReadXml Metodu 633
Excel Programı ve XML 634
Proje: XML Sample - XMLDocument 634
Proje: TCMB Kur Çek 638
DataSet Sınıfı ve XML Proje: Haber Siteleri ve RSS 18 THREAD 646
649
655
Thread 655
Proje: ThreadSample 19 SQL SERVER 659
663
Veritabanı, SQL Sorgulama Dili, SQL Server 663
SQL Server 2012 Kurulumundaki Önemli Noktalar 664
SQL Server Instance: Default Instance, Named Instance 665
Server Configuration, Collation Sekmesi (Dil Seçenekleri) 665
Database Engine Configuration, Server Configuration Sekmesi 666
Authentication Mode: Windows Authentication, Mixed Mode Data Directories Data, Temp ve Backup Verileri Ayrı Disklerde Olsun C#_ile_Projeler_ICINDEKILER.indd 25
666
667
668
26.12.2013 16:29
XXVI
PROJELER İLE C# VE SQL SERVER
SQL Server Managament Studio Northwind Veritabanı Sistem Veritabanlarının Görevleri Normalizasyon Kuralları 669
669
670
671
Tablolarda İlişkiler 672
Primary Key 672
Unique Özelliği 673
Unique ve Primary Key Benzerliği 673
Foreign Key 673
Diğer Kısıtlayıcılar 673
Check Constraint 673
Unique Constraint, Default Constraint 674
İlişkisel Veritabanı 674
Sorgu Nereye Yazılır? 678
USE, GO, Print 680
Sorgu Yazmak: Select Sorgusu 680
Sorgu Yazarken Dikkat Etmeniz Gerekenler 681
Sorgu Sonucunu Excel Programına Kopyalamak 682
Sorguda Koşul(Where), Between 682
Koşulda Bir İşlem Sonucunu Kullanmak 683
Distinct (Sorguda Sütun Tekrarlarının Önüne Geçmek) 684
AND 685
OR 686
IN 687
Like, Özel Karakterler 688
Space 690
Null, Is Null Operatorü 691
IsNull Function, Order By 692
Top 693
With Ties 694
Replicate (Veri Tekrarla) 695
C#_ile_Projeler_ICINDEKILER.indd 26
26.12.2013 16:29
İÇİNDEKİLER
Tip Çevirim İşlemleri XXVII
695
Convert 695
Tarih Tipi Çevirimleri 697
Cast 698
Transact-SQL 699
DML Select, Update, Insert, Delete 699
699
DDL 699
Create Table 699
Alter Table, Drop Table, Create Index 700
DCL 700
SQL Server Fonksiyonları Date Functions DateDiff, GetDate 700
700
700
DatePart 701
DateAdd: Bir Ay Sonrasını Bulmak, Ay Sonunu Bulmak 703
DateName, Day, Month, Year 704
DateFromParts, DateTimeFromParts, SmallDateTimeFromParts 705
TimeFromParts, SysDateTime, GetUtcDate 705
Eomonth (Ay Sonu), Conver 706
Tarih Formatını Geçici Olarak Değiştirmek 706
Aggregate Functions (Toplam Fonksiyonları) Avg, Count, Sum, Max-Min 706
708
Scalar Functions 708
Upper, Lower 708
SubString 709
Len, Round 710
Ascii, Char 710
CharIndex, Left-Right 711
RTrim-LTrim, Replace 711
Reverse, Format, Group By 712
C#_ile_Projeler_ICINDEKILER.indd 27
26.12.2013 16:29
XXVIII
PROJELER İLE C# VE SQL SERVER
Having 714
Koşul Kontrolleri 716
Case 716
IIf 720
Set Statement 720
DateFirst, DateFormat 720
Concat_Null_Yields_Null, IdentityInsert 721
Language 722
Join 722
Inner Join 722
Left Join, Right Join, Outer Join, Full Join, Bir Tabloya Veri Eklemek 723
InnerJoin Örneği 725
Left Join Örneği 726
Right Join Örneği 727
Edit Modunda Sorgu Yazmak 728
Full Join Örneği 729
Değişken Kullanımı 734
Nokta Virgül Ayarları ve Replace Fonksiyonu 734
Information_SCHEMA 735
Veritabanı Tablolarını Listelemek 735
Bir Sorguda Farklı Veritabanlarında İşlem Yapmak 736
Veritabanı Sütunlarını Listelemek 737
Check Constraint Bilgisi, Table Constraint Bilgisi 737
Prosedür ve Fonksiyon Parametrelerini Listelemek 737
Prosedür ve Fonksiyon Scripts Listelemek 737
View ve Scripts Listelemek 737
View Başvuru Tablosu Listesi 738
Constraint 738
Primary Key Constraint, Foreign Key Constraint, Unique Constraint 738
Default Constraint, Check Constraint 739
Çeşitli SQL Server Sorgu Örnekleri C#_ile_Projeler_ICINDEKILER.indd 28
741
26.12.2013 16:29
İÇİNDEKİLER
XXIX
Kullanılan Dil Yapısı, User Name, Kullanıcı Rolleri, Diyagram Listesi 741
Veritabanı Dosya Yolunu Bulmak Identity Column and Increment 741
743
Identıty Column ID Değerini Resetlemek 745
Son Identity Değerini Bulmak 745
@@Identity 745
Scope_Identity, Ident_Current 746
Sorgularda Sıra Numarası-Row_Number 747
Sıra Numarasını Gruplamak-Dense_Rank 747
Design Modu Prevent Saving Changes (Değişikliklerim Geçerli Olmuyor) 748
749
Refresh 750
DML 750
INSERT 750
Sütun Belirtmeden Insert Sorgusu Yazmak 753
Aynı Anda Birden Fazla Veri Insert Etmek 753
Tablodaki Verilerin Yedeğini Almak 754
BULK INSERT 755
UPDATE 756
DELETE 757
TRUNCATE 758
Tekrar Eden Verileri Silmek Query Designer 758
765
Diagram 765
Criteria, SQL Sorgusu 766
Change Type (Sorgu Tipini Değiştirmek) 770
Insert Values 771
Update 772
Delete 773
Sorguları Gruplamak 774
SQL Profiler-Profiler Özelleştirmesi 775
C#_ile_Projeler_ICINDEKILER.indd 29
26.12.2013 16:29
XXX
PROJELER İLE C# VE SQL SERVER
SQL Server Instance 776
SQL Server Snippets 778
Setting Import - Export 779
General Settings: Customize, Options, Environment 780
New Query Hazır Gelsin 780
Designers (Tablodaki Değişiklikler Kabul Edilsin) 781
Object Explorer 781
Select Top 1000 Rows Değişsin Text Editor: Satır Numarası, Satıra Sığmayan Verinin Alt Satıra İnmesi, Tab Setting Export 781
782
782
783
View 784
Create 784
Alter, View Order By 785
Top 786
Sub Query 786
View Konumu 787
With Check Option ile View Kontrolü 788
Şifreleme, With Schemabinding 790
Table Design 791
Northwind For Views 793
Tables For DDL 795
Create Table, Alter Table, Drop Table 795
Create Index, Constraints (Kısıtlayıcılar) 796
Object Explorer ile Tablo Oluşturmak, Veri Tipleri 808
Script Kullanmak 810
Union Operatörü, Union All Operatörü 816
Yürüyen Bakiye 820
RowNumber, DenseRank ve Over 823
Stored Procedure Parametrelerde Like Kullanımı C#_ile_Projeler_ICINDEKILER.indd 30
824
825
26.12.2013 16:29
İÇİNDEKİLER
Procedure ile Değer Döndürmek 826
Employees Tablosuna Yeni Bir Personel Ekleyen Prosedür 826
Yeni Bir Kategori Ekleyen Prosedür 828
Ürün Miktarı ve Fiyatını Ekleyen Prosedür 829
Ürün ve Kategorisini Ekleyen Prosedür 831
Identity Sütunu Resetleyen Prosedür 832
Identity Sütunu Bulmak 834
Prosedürlerin Konumu Ürünü ve Kategorisini Silen Prosedür XXXI
835
836
Functions 839
KDV Fonksiyonu 840
Fonksiyonların Konumu 840
İki Tarih Arasındaki Farkı Bulan Fonksiyon 841
Ayın Son Gününü Döndüren Fonksiyon 841
Tarihleri Türkiye formatında gösteren Fonksiyon 842
Ay Adını Döndüren Fonksiyon 843
Tablo Döndüren Fonksiyon 843
Trigger 844
After Trigger, Instead Of 845
Kategoriler Tablomdan Veri Silinemesin, Güncellenemesin 846
Kategoriler Tabloma Veri Eklenemesin 846
After Insert-Update-Delete 847
Disable Trigger 848
Güncellenen Verinin Önceki Hali ve Sona Hali 848
Shippers Tablosundan Silinen Veriyi Yedeklemek 849
Trigger Konumu 851
Koşullu Çalışan Trigger ve Rollback 851
Transaction 851
Güncellemeyi Geri Sarmak, Transaction ve Rollback 852
Her Sorgu (Update/Delete/Insert/Drop) Öncesi Transaction 853
Transaction Bankamatik 854
C#_ile_Projeler_ICINDEKILER.indd 31
26.12.2013 16:29
XXXII
PROJELER İLE C# VE SQL SERVER
Açık Kalan Transacitons ve Zararları Clustered Index 863
864
Backup 866
Full Backup, Differential (Fark) Backup 866
Transaction Log Backup, Backup İşlemi 867
Restore İşlemi 869
Veritabanına Kimler Bağlı 870
Connection (Bağlantı) Info, Session (Oturum) Info 870
Bağlı Kullanıcıların Bağlantılarını Kesmek 871
Backup Restore Sample 872
Backup Sample, Sorgu ile Backup Geri Yükleme Simulasyonu, Restore Sample 873
875
Options Sekmesi 876
Zamana Göre Restore, Yedek Dosyası Raporu 879
Log Backup Geri Yükleme İşlemi, Restoring Mode 884
Backupset 884
Script İşlemleri 885
Otomatik Script Oluşturma 885
Script İle Backup (Yedekleme) 887
Veritabanı MDF ve LDF Dosyalarına Ulaşmak, MDF Kopyalama 890
Full Text Search 894
Katalog 895
Indeks 897
İçerik 899
Full Text Search Kullanımı 900
Contains 900
Full Text 901
Agent 901
General, Steps 902
Schedules 903
Maintenance Plans ve Backup C#_ile_Projeler_ICINDEKILER.indd 32
904
26.12.2013 16:29
İÇİNDEKİLER
Shrink Databases ayarları 907
Differential Backup için ayarları 908
SQL Server Logins: 912
SQL Server Authentication Kullanıcısı Eklemek 912
Windows Authentication Kullanıcısı Eklemek 914
Excel Programına Veri Göndermek 916
Choose a Data Source 916
Choose a Destination 917
Select Source Tables and Views 918
Review Data Type Mapping, Save and Run Package 919
Excel Programından Veri Almak 920
Choose a Data Source 921
Choose a Destination 921
Select Source Tables and Views 922
Review Data Type Mapping 922
Save and Run Package 923
20 OBJECT ORIENTED PROGRAMING Nesne Yönelimli Programlama Abstraction, Inheritance, Polymorphism, Encapsulation Class Bileşenleri XXXIII
925
925
925
926
Methods, Fields, Properties, Constructors, Events, Delegates 926
Proje: Object Oriented Programıng Kisi Class 927
Proje: OOP Bisiklet Montaj 934
Proje: OOP Araç Galerisi 940
ListBox Kontrolünde Delete Tuşu ile Veri Silmek 957
Resim Yükleme İşlemi 957
Resmi Sürükle Bırak Yöntemi ile Yüklemek 958
Architecture 958
Show On Code Map 960
Proje: DragDrop 962
Class Library ve Inheritance 967
C#_ile_Projeler_ICINDEKILER.indd 33
26.12.2013 16:29
XXXIV
PROJELER İLE C# VE SQL SERVER
User Control Referans Yüklemek 970
971
Proje: MineTextBox - ClassLibrary - Class. 972
Miras Alma İşlemi (Inheritance) 975
DLL Kütüphanesinin Kullanımı Proje: User Control Kullanmak 979
979
21 RUNTIME CONTROLS 983
RunTime Controls Add 983
Proje: Runtime Controls / Seyahat İşletmesi 22 RESİM İŞLEMLERİ Resim Galerisi Mac Ronalds - Hamburgerci Resource Yöntemi ile Resim Yüklemek Disk Klasör ve Dosya Listeleyici StatusStrip Kontrolü 983
999
999
1012
1012
1022
1023
QRCode-Kare Kod 1037
Çoklu Form Çalışmaları 1045
Aynı Proje İçerisinden Erişim 1045
Farklı Projeden Erişim 1049
23 ACTIVEX DATA OBJECT .NET 1053
Activex Data Object .NET 1053
Connected Mimari 1053
Connected Mimaride Kullanılan Sınıflar 1053
SQLConnection 1053
SQLCommand, SQLDataReader Disconnected Mimari Disconnected Mimaride Kullanılan Sınıflar 1054
1054
1054
SQLConnection 1054
SqlDataAdapter 1054
C#_ile_Projeler_ICINDEKILER.indd 34
26.12.2013 16:29
İÇİNDEKİLER
XXXV
SqlDataSet 1055
Proje: Activex Data Object Connected Mimari 1056
Actıvex Data Object ve SQL Server Profiler 1058
Connected Mimari ve Data Reader Proje: DataReader 1060
1060
Active Directory ve ADO .NET Bağlantısı 1064
SQL Command Metotları 1064
ExecuteNonQuery, ExecuteReader 1064
CommandBehavior Enum Listesi, CloseConnection, SingleRow 1065
ExecuteSclar 1065
Proje: Disconnected Mimari 1065
ADO Bağlantı Cümleleri 1068
Enabling Multiple Active Result Sets 1069
Stored Procedure ve SqlCommand Proje: SQL Server Prosedürü Kullanmak Bir Projeyi Referans Olarak Kullanmak 1070
1073
1106
Data Table ve DataBinding 1126
Proje: Binding Context 1126
24 CLASSES VE ADO.NET 1135
Classes ve ADO.NET 1135
Proje: NorthwindForClasses 1136
Entity Class Library 1137
Excel ile Class Hazırlamak 1140
Tool Class Library 1142
Facade Class Library 1144
DataReader Null Kontrolü 1148
DataGridView Kontrolünde Arama 1155
25 ENTITY FRAMEWORK VE LINQ 1163
Proje: Entity Data Model ve Linq 1164
ADO.NET Entity Data Model C#_ile_Projeler_ICINDEKILER.indd 35
1165
26.12.2013 16:29
XXXVI
PROJELER İLE C# VE SQL SERVER
Entity Data Model Wizard, Choose Model Contents 1165
Choose Your Data Connection 1166
Choose Your Database Objects and Settings 1167
DataTable Load Metodu ve DataReader 1172
Linq ve Lambda Expression Proje: Linq ve Lambda Expression 1176
1176
SelectionChangeCommitted 1180
Linq ve Lambda Expression Join DataGridView Satır Numaralandırma 1183
1183
Proje: Linq ve Lambda Join 1185
Proje: Empty Model 1190
CRUD Class 1203
Kontrollerin Tag Özellikleri 1218
Application Sınıfı OpenForms Özelliği 1224
Açık Formlara Erişim Projeleriniz için Tavsiyeler C#_ile_Projeler_ICINDEKILER.indd 36
1224
1225
26.12.2013 16:29

Benzer belgeler

içindekiler

içindekiler İlk Form Uygulaması, Design, Form Özellikleri (Properties)  Form Appearance Properties, BackColor  

Detaylı

içindekiler

içindekiler Form Appearance Properties 

Detaylı

2 .NET Framework 2 O

2 .NET Framework 2 O New Horizontal/Vertical Tab Group - Reset Window Layout 

Detaylı