I enabled the TCP/IP protocol as shown in this screen shot. In the tree list on the left, open the SQL Server Network Configuration note and select the Protocols for your instance of SQL Server. So, this requires a change in SQL Server Configuration Manager. The command times out because the protocol to make the connection to SQL Server Express has not been enabled. Net code to open the connection.Ĭonn.ConnectionString = "Data Source=(local) Initial Catalog=tempdb Integrated Security=True" Now the red squiggly disappears and the code compiles, but there was still a problem when I tried the. Click to download the package from NuGet. In the image above, the SqlClient item has a green arrow because I had already downloaded it when I took the screen shot. The correct package showed at the top of the list. In the Manager, click Browse (is it a tab?) and enter in the search box. The option is called "Manage NuGet Packages," as shown in this screen shot. In Visual Studio, I found the manager for NuGet in the Project menu. I had heard of NuGet and had acually used it before, so that would seem to be a good place to start. NuGet is a code repository supported by Microsoft for sharing code as packages. When I was looking for something else (actually to answer a question in response to my article about the SqlConnection object), I saw an item from a Google search that suggest that the person should use NuGet. The dlls for the namespace were not included with the packages that come with Visual Studio Community Edition.Īctually the solution was a lot simpler than I thought it might be: NuGet. However, when I looked at the code in Visual Studio I got the dreaded red squiggly line on the SqlClient namespace: I downloaded and installed the free SQL Server Express Edition and Microsoft Visual Studio Community Edition. I thought I would write about the process and maybe save someone else some problems. The idea for this article was prompted when I tried to run the examples from the free versions of Visual Studio and SQL Server Express. Net application, to explain how to work with with SQL Server data, what is possible, and how to work with the issues that can come up. This is another in an occasional series of short articles about working with SQL Server data in a.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |