none
Reference .dll for the class UserDefinedSqlServerData RRS feed

  • Question

  • I have this silly situation. I used this class (UserDefinedSqlServerData) in my previous project which is now alive and well. It is huge unfortunately. I was greedy to write many classes that I did not really need and this MS class in question is in one of them like:

    UserDefinedSqlServerData data = new UserDefinedSqlServerData();

    It is all about connecting to my SQL Server. Now I am writing another application and need to use this MS class and I cannot find reference .dll for it. In the old application there are so many Microsoft.SqlServer... references that I simply cannot go through them all. Microsoft sucks. Why do they make things so difficult for user to put things together. It is horrible.

    How can I find this .dll?

    Thanks, - MyCatAlex

    Monday, November 11, 2019 12:40 AM

Answers

  • If you find it difficult to reuse your code, that is because you wrote it that way.  Move the code you want to reuse into a class library project and reference it in other projects. Go get a design pattern book and learn how to make your code decouple from things specific to your current project. 


    Visual C++ MVP

    • Marked as answer by MyCatAlex Tuesday, November 12, 2019 4:40 PM
    Monday, November 11, 2019 1:56 AM
  • I have this silly situation. I used this class (UserDefinedSqlServerData) in my previous project which is now alive and well. It is huge unfortunately. I was greedy to write many classes that I did not really need and this MS class in question is in one of them like:

    How is the UserDefinedSqlServerData a Microsoft class? It seems that it is a class that either you or someone else wrote that was involved in making the class and its methods/behavior.

    It is all about connecting to my SQL Server. Now I am writing another application and need to use this MS class and I cannot find reference .dll for it.

    Where is the source code that is usually kept in a code repository?

    In the old application there are so many Microsoft.SqlServer... references that I simply cannot go through them all. Microsoft sucks. Why do they make things so difficult for user to put things together. It is horrible.

    IMO. I don't see this as a MS problem, but rather, it's a software developer's created problem that may or may not have been created by you or by someone else involved in the project..



    • Edited by DA924x Monday, November 11, 2019 2:07 AM
    • Marked as answer by MyCatAlex Tuesday, November 12, 2019 4:40 PM
    Monday, November 11, 2019 2:06 AM
  • I would think you would have a class file named UserDefinedSqlServerData.cs which you could then search your folder where source code is kept to find it. 

    Also, this is why it's wise to place source code into source control and when there is a chance of reusable classes to place them into a shared library/project. Most likely the .DLL file has a completely different name then the class. So if the .DLL and project name are not know search in files for SqlConnection since you indicated the code is for connecting to SQL-Server.

    Why does Microsoft has many references, because this compartmentalizes classes along with placing them in proper namespaces for easy access and to not collide with other classes with same names and similar method and property names.

    A good example is Entity Framework Core which has a base DLL and other DLL to support different data providers (huge list). It would not make sense to place Oracle, SQL-Server and MS-Access classes in the same DLL when a user needs but one data provider. And the beauty is install from NuGet a EF Core provider and the base EF library gets pulled in too.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by MyCatAlex Tuesday, November 12, 2019 4:39 PM
    Monday, November 11, 2019 2:54 AM
    Moderator

All replies

  • If you find it difficult to reuse your code, that is because you wrote it that way.  Move the code you want to reuse into a class library project and reference it in other projects. Go get a design pattern book and learn how to make your code decouple from things specific to your current project. 


    Visual C++ MVP

    • Marked as answer by MyCatAlex Tuesday, November 12, 2019 4:40 PM
    Monday, November 11, 2019 1:56 AM
  • I have this silly situation. I used this class (UserDefinedSqlServerData) in my previous project which is now alive and well. It is huge unfortunately. I was greedy to write many classes that I did not really need and this MS class in question is in one of them like:

    How is the UserDefinedSqlServerData a Microsoft class? It seems that it is a class that either you or someone else wrote that was involved in making the class and its methods/behavior.

    It is all about connecting to my SQL Server. Now I am writing another application and need to use this MS class and I cannot find reference .dll for it.

    Where is the source code that is usually kept in a code repository?

    In the old application there are so many Microsoft.SqlServer... references that I simply cannot go through them all. Microsoft sucks. Why do they make things so difficult for user to put things together. It is horrible.

    IMO. I don't see this as a MS problem, but rather, it's a software developer's created problem that may or may not have been created by you or by someone else involved in the project..



    • Edited by DA924x Monday, November 11, 2019 2:07 AM
    • Marked as answer by MyCatAlex Tuesday, November 12, 2019 4:40 PM
    Monday, November 11, 2019 2:06 AM
  • I would think you would have a class file named UserDefinedSqlServerData.cs which you could then search your folder where source code is kept to find it. 

    Also, this is why it's wise to place source code into source control and when there is a chance of reusable classes to place them into a shared library/project. Most likely the .DLL file has a completely different name then the class. So if the .DLL and project name are not know search in files for SqlConnection since you indicated the code is for connecting to SQL-Server.

    Why does Microsoft has many references, because this compartmentalizes classes along with placing them in proper namespaces for easy access and to not collide with other classes with same names and similar method and property names.

    A good example is Entity Framework Core which has a base DLL and other DLL to support different data providers (huge list). It would not make sense to place Oracle, SQL-Server and MS-Access classes in the same DLL when a user needs but one data provider. And the beauty is install from NuGet a EF Core provider and the base EF library gets pulled in too.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by MyCatAlex Tuesday, November 12, 2019 4:39 PM
    Monday, November 11, 2019 2:54 AM
    Moderator
  • Shame on me. This class is in fact a short two line class giving the location on the LAN backup data and log SQL Server folders. Did not cross my mind that it was so simple. Sorry - MyCatAlex

    public class UserDefinedSqlServerData
        {
            public string dataFolder = @"L:\Backup\";
            public string logFolder = @"L:\LogBackup";
        }                                               // UserDefinedSqlServerData

    • Edited by MyCatAlex Tuesday, November 12, 2019 4:44 PM
    Tuesday, November 12, 2019 4:43 PM