Kayıtlar

Windows 8 üzerinde domainden çıkmadan .net3.5 framework kurmak

Resim
başlık garip gelebilir velhasıl eğer şirketinizde windows update sorunu yaşıyorsanız genelde bu bağlantı hatası yaratır. windows update size bağlantı hatası olarak döner, internet bağlı olduğunuz halde bağlanamıyorum hatası çok açıklayıcı bilgi içermez. Bu iş için offline metod kullanacağız. Adım 1: Windows 8 DVD veya mount ISO görüntü ekleyin. Bu özellik, kaynak  E:\sources\sxs klasöründe bulunabilir. (Bu durumda  F: kullanıcının sürücü harfi üzerinde kullanıcının yüklenen Windows 8 ortam.) Adım 2: Run as administrator modunda  CMD.EXE  yönetici ayrıcalıklarına sahip.  Adım 3: Aşağıdaki komutu çalıştırıp  C:\Windows\system32>Dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:F:\sources\sxs /LimitAccess  ve Enter tuşuna basın.  .NET Framework 3.5 yüklenmesi tamamlandıktan sonra özelliğinin etkin olduğunu görebilirsiniz. Ayrıntılı bilgi için http://support.microsoft.com/kb/2785188/tr

Formu get ile post etmek ne manaya gelir

The form tag in the preceding code snippet does not include a method attribute. The method attribute tells the browser whether to use an HTTP POST or HTTP GET when sending the information. You might think the default method for a form is HTTP POST. After all, you regularly POST forms to update your profi le, submit a credit card purchase, and leave comments on the funny animal videos on YouTube. However, the default method value is “get,” so by default a form sends an HTTP GET request: 1 2 3 4 <form action= "http://www.bing.com/search" method= "get" > <input name= "q" type= "text" /> <input type= "submit" value= "Search!" /> </form> When a user submits a form using an HTTP GET request, the browser takes the input names and values inside the form and puts them in the query string. In other words, the preceding form would send the browser to the following URL (assuming the user is searching for ...

Code first entity framework ile console ile migration işlemleri

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 PM > Enable - Migrations No packages installed . The EntityFramework package is not installed on project ' WorkSpace ' . PM > Enable - Migrations No packages installed . The EntityFramework package is not installed on project ' WorkSpace ' . PM > Enable - Migrations No packages installed . The EntityFramework package is not installed on project ' WorkSpace ' . PM > Install - Package EntityFramework ' EntityFramework 6.1 . 2 ' already installed . Adding ' EntityFramework 6.1 . 2 ' to WorkSpace . Successfully added ' EntityFramework 6.1 . 2 ' to WorkSpace . Type ' get - help EntityFramework ' to see all available Entity Framework commands . One or more packages could not be completely uninstalled: EntityFramework . 6.1 . 1 . Restart Visual Studio...

Include metodu ne için kullanılır?

Kod örneğimiz şekildeki gibi 1 2 3 4 5 public ViewResult Index () { var albums = db.Albums.Include(a => a.Genre).Include(a => a.Artist); return View (albums.ToList()); } LOADING RELATED OBJECTS The Include method calls that you see in the Index action tell the EF to use an eager loading strategy in loading an album’s associated genre and artist information. An eager loading strategy attempts to load all data using a single query. The alternative (and default) strategy for the EF is a lazy loading strategy. With lazy loading, EF loads only the data for the primary object in the LINQ query (the album), and leaves the Genre and Artist properties unpopulated: 1 var albums = db.Albums; Lazy loading brings in the related data on an as-needed basis, meaning when something touches the Genre or Artist property of an Album, EF loads the data by sending an additional query to the database. Unfortunately, when dealing with a list of album information, a lazy loadin...

Data Access Layer yaklaşımları nasıl olmalı

There are many different approaches to accessing data these days, and the approach you use will depend not only on the type of application you build, but also on your personality (or your team’s personality). There is no single data access strategy that can work for all applications and all teams. The approach in this chapter uses the tooling of Visual Studio and will get you up and running quickly. There isn’t anything explicitly wrong with the code; however, for some developers and some projects, the approach is too simplistic. The scaffolding we use in this chapter assumes you are building an application that needs to implement basic create, read, update, and delete (CRUD) functionality. Many applications exist only to provide CRUD functionality with basic validations and a minimal amount of business workfl ows and business rules. The scaffolding works well for these applications. For more complex applications you’ll want to investigate different architectures and design pattern...

CA2202: Do not dispose objects multiple times hatasına yaklaşım

Visual studio.net ile projenizi açtınız. Ve solution explorer üzerinde sağ tuşa tıklayıp cod analyzer çalıştırdınız. Karşınıza başlıktaki gibi bir hata mesajı geliyorsa yapabileceğiniz çözüm try finally bloğunu kullanmaktır. Problemin kaynağı A method implementation contains code paths that could cause multiple calls to  IDisposable . Dispose  or a Dispose equivalent, such as a Close() method on some types, on the same object. Örneğin iç içe use kullandınız diyelim 1 2 3 4 5 6 7 using (Stream stream = new FileStream( "file.txt" , FileMode.OpenOrCreate)) { using (StreamWriter writer = new StreamWriter(stream)) { // Use the writer object... } } Daha sonra bu örneği değiştirmek istersek 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Stream stream = null ; try { stream = new FileStream( "file.txt" , FileMode.OpenOrCreate); using (StreamWriter writer = new StreamWriter(stream)) { stream = null ; ...

Dynamic keyword in the asp.net views

Suppose you need to write a view that displays a list of Album instances. One possible approach is to simply add the albums to the view data dictionary (via the ViewBag property) and iterate over them from within the view. For example, the code in your Controller action might look like this: 1 2 3 4 5 6 7 8 public ActionResult List () { var albums = new List<Album>(); for ( int i = 0 ; i < 10 ; i++) { albums.Add( new Album {Title = "Product " + i}); } ViewBag.Albums = albums; return View (); } In your view, you can then iterate and display the products, as follows: 1 2 3 4 5 <ul> @foreach (Album a in (ViewBag.Albums as IEnumerable <Album> )) { <li> @a.Title </li> } </ul> Notice that we needed to cast ViewBag.Albums (which is dynamic) to an IEnumerable before enumerating it. We could have also used the dynamic keyword here to clean the view code up, but we would have lost the benefi t of IntelliSense when accessing the pr...