TAILIEUCHUNG - Visual studio 2010 part 22

Microsoft Visual Studio 2010: A của Hướng dẫn mới bắt đầu tùy chọn tìm thấy sau khi nhấp vào nút mũi tên để mở rộng cơ sở dữ liệu Công cụ và sau đó chọn Bảng và cơ sở dữ liệu thiết kế là "Ngăn chặn lưu thay đổi đó có yêu cầu tái tạo bảng." VS sẽ không cho phép bạn lưu một sự thay đổi nước ngoài quan trọng để bàn hiện tại. Tuy nhiên, bằng cách bỏ chọn "Ngăn chặn thay đổi bảng tiết kiệm đó có yêu cầu tái tạo", bạn sẽ có thể lưu thay đổi. | 194 Microsoft Visual Studio 2010 A Beginner s Guide options found after clicking the arrow button to expand Database Tools and then selecting Table And Database Designers is Prevent saving changes that require table re-creation. VS will not allow you to save a foreign key change to existing tables. However by unchecking Prevent saving changes that require table re-creation you ll be able to save foreign key changes to an existing table. As with so many other features of VS there are literally dozens of database settings most are intuitive if you already understand SQL Server. Other options differ depending on the version of VS you have and your Options screen might not look the same as Figure 7-10. Now that you know how to create databases tables and stored procedures you ll need to know how to use your database from code. The rest of this chapter shows you how to use LINQ to work with data. First we ll look at the basic syntax of LINQ through LINQ to Objects and then follow with working with SQL Server through LINQ to SQL. Learning Language Integrated Query LINQ LINQ is a set of features built into programming languages such as C and VB for working with data. It s called Language Integrated Query because the LINQ syntax is part of the language as opposed to being a separate library. This section will show you the essentials of LINQ with LINQ to Objects a LINQ provider for querying in-memory collections of objects. The great news is that the syntax you learn here is not only applicable to LINQ to Objects but to all other LINQ providers such as LINQ to SQL and more that you ll encounter. The examples in this chapter will use a Console project for simplicity. Later chapters will show you how to display data in desktop and Web applications. If you want to run the code in this chapter you can create a Console application and type the examples into the Main method as has been explained in each previous chapter of this book. Querying Object Collections with LINQ One way

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.