Book Image

Beginning C# 7 Hands-On ??? Advanced Language Features

By : Tom Owsiak
Book Image

Beginning C# 7 Hands-On ??? Advanced Language Features

By: Tom Owsiak

Overview of this book

Beginning C# 7 Hands-On – Advanced Language Features assumes that you’ve mastered the basic elements of the C# language and that you're now ready to learn the more advanced C# language and syntax, line by line, in a working Visual Studio environment. You'll learn how to code advanced C# language topics including generics, lambda expressions, and anonymous methods. You'll learn to use query syntax to construct queries and deploy queries that perform aggregation functions. Work with C# and SQL Server 2017 to perform complex joins and stored procedures. Explore advanced file access methods, and see how to serialize and deserialize objects – all by writing working lines of code that you can run within Visual Studio. This book is designed for beginner C# developers who have mastered the basics now, and anyone who needs a fast reference to using advanced C# language features in practical coding examples. You'll also take a look at C# through web programming with web forms. By the time you’ve finished this book, you’ll know all the critical advanced elements of the C# language and how to program everything from C# generics to XML, LINQ, and your first full MVC web applications. These are the advanced building blocks that you can then combine to exploit the full power of the C# programming language, line by line.
Table of Contents (35 chapters)
Title Page
Credits
About the Author
www.PacktPub.com
Customer Feedback
Preface

Reviewing what you created already in SQL Server


Next, open the SQL Server Object Explorer screen. Now, remember that you made a database called People and then within it you have a table also called People. Further, within that you have a column called Id. This is the primary key. Remember, that it's auto-incremented so that you don't have to specify the ID. That is, it's done for you automatically.

Next, there are two fields: one is NAME, and the other one is DATEADDED; NAME is varchar(100) and DATEADDED is of type date. Both values have to be supplied, and that's why it says not null. The SQL Server Object Explorer screen up to this point is shown in Figure 18.3.2:

Figure 18.3.2: The SQL Server Object Explorer screen for the database People

Creating a new stored procedure

Now, expand the Programmability folder. There's a folder called Stored Procedures. Right-click on that, and select Add New Stored Procedure... . This is the basic stored procedure code:

Figure 18.3.3: The default Stored Procedure...