Skip to main content

Knowing Nuget and installing a Package

 For .NET Microsoft-supported mechanism for sharing code is NuGet, which defines how packages for .NET are created, hosted, and consumed, and provides the tools for each of those roles.
It has been an essential tool for through which developers can create, share, and consume useful code. Often such code is bundled into "packages" that contain compiled code (as DLLs) along with other content needed in the projects that consume these packages.

How to add Nuget Package to an application

  1. Right click Refrences -> Manage Nuget Packages2.  Type Nuget Package Name you need for the application here we add Entity Framework

    3.  After the search result is shown click install and accept the agreement asked
After this the package is installed and you can use the functionalities that are provided by the package.

Comments

Post a Comment

Popular posts from this blog

Using SqlDataAdapter to fill DataTable in c#

public DataTable List(string sql)         {             SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);             SqlCommand cmd = new SqlCommand(sql, con);             DataTable dt = new DataTable();             SqlDataAdapter da = new SqlDataAdapter(cmd);             try             {                              con.Open();                 da.Fill(dt);             }             finally             {                 con.Close();          ...

Connection String in ASP.NET With SQL Server

Connection string can be placed in web.config file found in root directory of the application from .NET 3.5 onward. connection string can be specified with an xml tag  <connectionStrings>  inside  <configuration>  section of web.config file. < connectionStrings > < add name = "myConnectionString" connectionString = "Data Source=databaseServerName; database=database-name; uid=sqlUserName;password=sqlPassword; Integrated Security =True|false|SSPI (any one options) ; " providerName = " System.Data.SqlClient System.Data.SqlClient" /> </ connectionStrings > We can use local database server of SQL Server by using Data Source= (LocalDb)\MSSQLLocalDB we can attach a local database file to the app_data directory by using the property AttachDBFilename=|DataDirectory|\appDatabaseName.mdf in the connection string Connection String can be ...