Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Read data from Azure database with C#-application, without installing a lot of applications?

Read data from Azure database with C#-application, without installing a lot of applications?

Scheduled Pinned Locked Moved Database
csharpdatabasevisual-studiocloudquestion
24 Posts 5 Posters 76 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A arnold_w

    There is only one table in the database. If it's not feasible to get the data by using a home-made function (or method), what is the minimum database client I need to install? Are there any lightweight (perhaps even open source?) clients available or do I need to install several Gbytes of SQL Server/Oracle/something else?

    M Offline
    M Offline
    Mycroft Holmes
    wrote on last edited by
    #6

    What do you expect to "browse" the data with? You could write a simple windows service or client which would connect and download the table. It would be very small.

    Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

    A 1 Reply Last reply
    0
    • M Mycroft Holmes

      What do you expect to "browse" the data with? You could write a simple windows service or client which would connect and download the table. It would be very small.

      Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

      A Offline
      A Offline
      arnold_w
      wrote on last edited by
      #7

      Mycroft Holmes wrote:

      What do you expect to "browse" the data with?

      That's a good question, see below.

      Mycroft Holmes wrote:

      You could write a simple windows service or client which would connect and download the table. It would be very small.

      So, you're basically saying I don't need a database client to get the table? What format will the table then be in when I get it locally on my computer? Will the format be something simple like tab/comma separated or XML or something so complicated (perhaps even encrypted) that I practically would need a database client to make sense out of the table?

      L 1 Reply Last reply
      0
      • A arnold_w

        It is a relational database I wish to access.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #8

        The majority of databases are relational types. What you need to find out is what software product is used to create it: Oracle, SQLServer, MySQL, SQLite etc.

        A 1 Reply Last reply
        0
        • A arnold_w

          Mycroft Holmes wrote:

          What do you expect to "browse" the data with?

          That's a good question, see below.

          Mycroft Holmes wrote:

          You could write a simple windows service or client which would connect and download the table. It would be very small.

          So, you're basically saying I don't need a database client to get the table? What format will the table then be in when I get it locally on my computer? Will the format be something simple like tab/comma separated or XML or something so complicated (perhaps even encrypted) that I practically would need a database client to make sense out of the table?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #9

          See my post below.

          1 Reply Last reply
          0
          • A arnold_w

            I am writing a C# application in Visual Studio 2005 and I need to read, but NOT write, data inside an Azure database and I would like to install as few applications on my computer as possible. It would also be nice if I could simply spend a couple of minutes copying the whole database file to my computer upon startup and from then on access the data completely locally. There is no requirement that I should access the data I want through SQL-queries, if it's feasible to iterate through the database file with while-loops, if-statements, etc that would be perfectly fine with me. Is this feasible or what's the minimum I can get away with?

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #10

            It just occurred to me that the answer to this is quite simple. Go and talk to the people who own the database, they will be able to tell you exactly which client libraries you need.

            1 Reply Last reply
            0
            • L Lost User

              The majority of databases are relational types. What you need to find out is what software product is used to create it: Oracle, SQLServer, MySQL, SQLite etc.

              A Offline
              A Offline
              arnold_w
              wrote on last edited by
              #11

              Ok, so Azure supports a wide range of databases.

              L 1 Reply Last reply
              0
              • A arnold_w

                Ok, so Azure supports a wide range of databases.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #12

                This has nothing to do with Azure. If you want to access a database then, as I already suggested, you need to know what type of database (i.e. which product is used to manage it). And the quickest way to find that answer is to talk to the people who own it.

                A 1 Reply Last reply
                0
                • A arnold_w

                  I am writing a C# application in Visual Studio 2005 and I need to read, but NOT write, data inside an Azure database and I would like to install as few applications on my computer as possible. It would also be nice if I could simply spend a couple of minutes copying the whole database file to my computer upon startup and from then on access the data completely locally. There is no requirement that I should access the data I want through SQL-queries, if it's feasible to iterate through the database file with while-loops, if-statements, etc that would be perfectly fine with me. Is this feasible or what's the minimum I can get away with?

                  J Offline
                  J Offline
                  jschell
                  wrote on last edited by
                  #13

                  arnold_w wrote:

                  I am writing a C# application in Visual Studio 2005 and I

                  2005 is rather old and I suspect that might be a problem. But maybe you meant 2015. For a database application you need 1. Access permission to the database. This includes a connection path and user permissions. This is information not code. 2. A connection library for the database. This a library. 3. Probably a framework that will use the connection library. 4. Then you use 3 to get data from the database where you have provided 1 to 2.

                  arnold_w wrote:

                  There is no requirement that I should access the data I want through SQL-queri

                  That is unlikely unless the database is a No-SQL database.

                  1 Reply Last reply
                  0
                  • L Lost User

                    This has nothing to do with Azure. If you want to access a database then, as I already suggested, you need to know what type of database (i.e. which product is used to manage it). And the quickest way to find that answer is to talk to the people who own it.

                    A Offline
                    A Offline
                    arnold_w
                    wrote on last edited by
                    #14

                    It is SQL Server.

                    L 1 Reply Last reply
                    0
                    • A arnold_w

                      It is SQL Server.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #15

                      OK, so you need to install SQL client on your system, and get the details of the database structure from the people who own it.

                      A 1 Reply Last reply
                      0
                      • L Lost User

                        OK, so you need to install SQL client on your system, and get the details of the database structure from the people who own it.

                        A Offline
                        A Offline
                        arnold_w
                        wrote on last edited by
                        #16

                        Is there no shortcut available? I'm open to using hacks.

                        V L 2 Replies Last reply
                        0
                        • A arnold_w

                          Is there no shortcut available? I'm open to using hacks.

                          V Offline
                          V Offline
                          Victor Nijegorodov
                          wrote on last edited by
                          #17

                          I'd recommend you to install SSMS (SQL Server Management Studio) instead.

                          1 Reply Last reply
                          0
                          • A arnold_w

                            Is there no shortcut available? I'm open to using hacks.

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #18

                            Are we to assume that you do not actually have permission to access this database?

                            A 1 Reply Last reply
                            0
                            • L Lost User

                              Are we to assume that you do not actually have permission to access this database?

                              A Offline
                              A Offline
                              arnold_w
                              wrote on last edited by
                              #19

                              No, I have access. Since this software will be run on other computers than my own, I'd like to keep 3rd party software installations/dependencies to a minimum. Ideally, all you'd have to do to run my application is to double-click an .exe-file (ideally, you should also be able to run it from a USB-stick), I don't want anybody to have to do anything more. That's why I don't use installers and instead embed all my dll:s and icons/pictures into my .exe-file, I don't like to give installation support, especially not on something I didn't write myself.

                              L M 2 Replies Last reply
                              0
                              • A arnold_w

                                No, I have access. Since this software will be run on other computers than my own, I'd like to keep 3rd party software installations/dependencies to a minimum. Ideally, all you'd have to do to run my application is to double-click an .exe-file (ideally, you should also be able to run it from a USB-stick), I don't want anybody to have to do anything more. That's why I don't use installers and instead embed all my dll:s and icons/pictures into my .exe-file, I don't like to give installation support, especially not on something I didn't write myself.

                                L Offline
                                L Offline
                                Lost User
                                wrote on last edited by
                                #20

                                Well at the risk of repeating myself yet again: go and talk to the owners of the database to find out what client software you need to install, and what the schema structure is. They are the only people who can provide this information.

                                1 Reply Last reply
                                0
                                • A arnold_w

                                  No, I have access. Since this software will be run on other computers than my own, I'd like to keep 3rd party software installations/dependencies to a minimum. Ideally, all you'd have to do to run my application is to double-click an .exe-file (ideally, you should also be able to run it from a USB-stick), I don't want anybody to have to do anything more. That's why I don't use installers and instead embed all my dll:s and icons/pictures into my .exe-file, I don't like to give installation support, especially not on something I didn't write myself.

                                  M Offline
                                  M Offline
                                  Mycroft Holmes
                                  wrote on last edited by
                                  #21

                                  Wait you already have an application that will consume the data! Why don't you modify your app to query the database?

                                  Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

                                  A 1 Reply Last reply
                                  0
                                  • M Mycroft Holmes

                                    Wait you already have an application that will consume the data! Why don't you modify your app to query the database?

                                    Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

                                    A Offline
                                    A Offline
                                    arnold_w
                                    wrote on last edited by
                                    #22

                                    No, I'm about to start writing an application.

                                    M 1 Reply Last reply
                                    0
                                    • A arnold_w

                                      No, I'm about to start writing an application.

                                      M Offline
                                      M Offline
                                      Mycroft Holmes
                                      wrote on last edited by
                                      #23

                                      Then write the database query into your application like every other developer does.

                                      Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

                                      1 Reply Last reply
                                      0
                                      • A arnold_w

                                        I am writing a C# application in Visual Studio 2005 and I need to read, but NOT write, data inside an Azure database and I would like to install as few applications on my computer as possible. It would also be nice if I could simply spend a couple of minutes copying the whole database file to my computer upon startup and from then on access the data completely locally. There is no requirement that I should access the data I want through SQL-queries, if it's feasible to iterate through the database file with while-loops, if-statements, etc that would be perfectly fine with me. Is this feasible or what's the minimum I can get away with?

                                        A Offline
                                        A Offline
                                        arnold_w
                                        wrote on last edited by
                                        #24

                                        I found a really great tool where I can browse for an .mdf-file and select it and then see the tables with all the data. It's called "SysInfoTools SQL File Viewer v18.0" and it's only a few megabytes large. After I have installed it, I can see a file called "Script Instruction.txt" in the installation folder with the following contents: "********************************************************************** Information about script ********************************************************************** Mainsqlscript.bat is our main script File, which contains path information of all the tables, views, stored procedure, triggers, functions,etc. Script file with database name “Databasename”.sql File contains script for creation of Database. Tables Folder Contain Script of all the tables. StoreProcedure Folder Contain script file for every Procedure. Triggers Folder Contain script file for every Trigger. Views Folder Contain script file for every view. Functions Folder Contain script file for every function. altertablecommandPrimarykeys contain script file for every primarykey. Altertablecommandforeignkeys contain script file for every foreign key. ********************************************************************** How to run Script ********************************************************************** 1. Open Command prompt. Cmd.exe with run as Administrator. 2. Move to Batch file path using command cd "Path of batch file" 3. Type Command mainsqlscript.bat NOTE: If the given Database name already exist in sql server instance then old database will be deleted and new database with the given name is created. Server Name and Database Name are compulsary parameters for running script." Does anybody understand what they mean by the above, does it mean that I can run it from a standard .bat-file (the ones that were invented by Microsoft in the 80's) and not have to see the GUI show up?

                                        1 Reply Last reply
                                        0
                                        Reply
                                        • Reply as topic
                                        Log in to reply
                                        • Oldest to Newest
                                        • Newest to Oldest
                                        • Most Votes


                                        • Login

                                        • Don't have an account? Register

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular
                                        • World
                                        • Users
                                        • Groups