Reading/Writing Data from a SQL Database

Hi,
I have a data structure called 'Quote' which contains a number of different variables and controls ranging from text boxes, check boxes and radio buttons, i need to be able to read and write this from a database.
First I think a description of my overall project is needed:
Project Description
I have been given a brief that basically says: i have to create a programmed solution in VB to solve a problem. This problem can be anything we like, and I personally have chosen to create a program that manages quotes for building Log Cabins (this is very contrived and far from anything someone would do in the real world).
My solution will allow a generic user to create a quote (using a form with controls such as text boxes, check boxes, radio buttons) , and then save this to file. These users may then wish to load/edit this quote at a later date, from another form.
Whilst completing this project, i'll only have up to about 5 records (quotes) within the system, so i dont need the ability to store hundreds of records. And each record will be relatively short, with only about 10-15 data items within the data structure.
Also the Admin (or business owner in this case) need to be able to view all saved quotes in a presentable format, and edit them if needs be, from within this same program.
This solution does not need to be absolutely perfect and 100% efficiently coded, or have all the bells and whistles a real-world program would have. This is for an A level computing project by the way.
So basically, i need to be able to read from the database (to populate a Data Grid (i imagine this is best way?)) and so Admin can access any quote and edit it (editing is not vital, but viewing/printing is. Maybe i should stop at just viewing any quote?). Also i need generic users to be able to fill in the Edit Quote form and then save this data into the database.
And is a data structure really required for me to use a database?
I've never used databases in VB before (but have used them elsewhere, mainly Access) and so am completely new to this. Any help will be much appreciated.
Thanks

this is just a dataset i created using the dataset designer.
OK, so i have the dataset called "MyDataSet".
I also have the following variables:
Code Snippet
Dim FloorSpace As Int32
Dim NoOfBedrooms As Int32
Dim NoOfBathrooms As Int32
Dim EnSuites As Int32
Dim LuxKitchen As Boolean
Dim LuxCabin As Boolean
Dim Flooring As Boolean
Dim VoiceLighting As Boolean
Dim SolarPanels As Boolean
Dim IntegralSound As Boolean
Dim WindowFrames As String
Each of which relates directly to a column in the dataset (data type matches too).
What i need to do now, is to save these variables as an additional record in MyDataSet. And then save MyDataSet to file, so it can be loaded again next time the program is run and more additional records added. (all files are local by the way).
how would i go about this?

Similar Messages

  • Transfering data from External SQL database to BW

    Hi Experts,
         I am trying to extract data from an External SQL Database  in BW using      
         DB Connect.
        1. I have created a  DB Source System.
        2. Using this Source System I have generated a Datasoure.
           ( following all the naming conventions for Table Names and Field Names)
        Till this point everything is OK.
        Then I assign a Infosource and try to upload the data into PSA.
        The process is never complete and I am getting a message
       <i> <b>Request still running
        Diagnosis
        No errors could be found. The current process has probably not finished yet.
        System response
        The ALE inbox of the SAP BW is identical to the ALE outbox of the source
        system
        and/or
        the maximum wait time for this request has not yet run out
        and/or
        the batch job in the source system has not yet ended.
        Current status
        No Idocs arrived from the source system</b>.</i>
         please help me.
      thanks
      arshad

    please first tell me which wich user you connect and the exact name of your table/view: is it dbo.table?
    as I said, better create a user in your SQL, log with this user and create a view.
    in RSBDC select this view and generate datasource. Check if you see data.
    if yes, the load shouldn't fail.
    We came across the same issue: login with sa, accessing a dbo. object; seing the data in RSDBC but nothing loading...
    let me know
    Olivier.

  • Is it possible to migrate WebCenter Portal data from a SQL database to an Oracle database?

    We have our WebCenter Portal applications set up using a SQL database. Now we're wanting to migrate to an Oracle database and I'm wondering if that is possible.

    Yes it should be possible though i have not tried it myself. You basically export a file from mds ( xml) and import it into oracle db.
    Thanks
    manish

  • Why is performance so slow reading binary data from a SQL Azure DB with EF6.x

    I'm running a WPF client that hits a SQL Azure DB using EF 6.x. For the most part, everything seems to be working fine. The one exception is when I try to read a large binary column.
    I am storing files in the DB as a binary column.  When I test using the local DB, everything sings.  When I switch to the Azure DB, I get timeouts when I try to read the file contents.  I have no problem saving the binary data to the DB, just
    reading it.
    I don't know how to troubleshoot this.  I looked at the Query Performance page in the Azure portal, but it doesn't time stamp anything in there and you can't clear it, so I can't correlate what's running with the queries that show up there.
    I tried to start SQL profiler against the DB, but was denied because I'm not a member of the sysadmin fixed server role.
    If I query for the data directly, it comes back quickly.  So this seems to be an Azure via EF issue.
    Any help is appreciated.
    http://digitalcamel.blogspot.com/

    Hi Digital Camel,
    Since I don't know what your scenario is, I won't argue too much about not storing binaries in your SQL DB, but still: don't store binaries in your SQL DB :). The main reason is simple: first and foremost, in both the current and future pricing tier your
    levels are defines on the size of the DB. Basically, you pay way more by storing your binaries on your SQL layer rathern than storing them elsewhere, such as Azure Storage. Second, the protocol your binaries would be downloaded over the wire is prone to network
    connectivity issues: you could use HTTP(S) or FTP instead, if you'd use Azure Storage. Last but not least, when you download the binary from your DB, you keep a connection open which in the end is a connection other users might have used to query data instead.
    However, in regard to your question, how did you "query for the data directly"? Did you try to query the data using SSMS with the Client Statistics option on? This could tell you if the problem is network, server or client related.
    Hope this helps!
    Alex

  • Reading data from Sybase SQL Anywhere 7 database to write into a SQL Server database

    Hi,
    I need to import data from a Sybase SQL Anywhere vers. 7 database. This RDBMS was used more 10-12 years ago. I want to write Sybase data into a SQL Server 2008 R2-2012 database. For testing purposes I'm using SQL Server 2005.
    After that I've installed Sybase SQL Anywhere vers. 7 I can use the Adaptive Anywhere 7.0 ODBC. I'd like to use SSIS to import Sybase data, but I cannot create an OLE DB connection in a right manner while I can create and ODBC connection manager and so I
    can use an Execute SQL task (and not a data flow task, unfortunately!).
    Well, after using this Execute SQL task to read fe a table with thousands of data rows how can I write the entire data collection on a SQL Server table?
    Thanks

    Below link may be helpful,
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/184c937a-2b2c-4e59-b4d7-e8d3d1b476b3/net-provider-for-oledb-sybase-adaptive-server-anywhere-ole-db-provider-90-cant-be-located-when?forum=sqlintegrationservices
    http://supun-biz.blogspot.in/2010/11/extracting-data-from-sybase-sql.html
    Regards, RSingh

  • Reading Data from a SQL table to a Logical file on R/3 appl. Server

    Hi All,
    We would like to create Master Data using LSMW (direct Input) with source files from R/3 Application Server.
    I have created files in the'/ tmp/' directory however I do not know how to read data from the SQL table and insert it into the logical file on the R/3 application server.
    I am new to ABAP , please let me know the steps to be done to acheive this .
    Regards
    - Ajay

    Hi,
    You can find lot of information about Datasets in SCN just SEARCH once.
    You can check the code snippet for understanding
    DATA:
    BEGIN OF fs,
      carrid TYPE s_carr_id,
      connid TYPE s_conn_id,
    END OF fs.
    DATA:
      itab    LIKE
              TABLE OF fs,
      w_file  TYPE char255 VALUE 'FILE',
      w_file2 TYPE char255 VALUE 'FILE2'.
    SELECT carrid connid FROM spfli INTO TABLE itab.
    OPEN DATASET w_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. "Opening a file in Application
                                                            " Server to write data
    LOOP AT itab INTO fs.
      TRANSFER fs TO w_file. "" Writing the data into the Application server file
    ENDLOOP.
    CLOSE DATASET w_file.
    OPEN DATASET w_file FOR INPUT IN TEXT MODE ENCODING DEFAULT. "Opening a file in Application
                                                          " server to read data
    FREE itab.
    DO.
      READ DATASET w_file INTO fs.
      IF sy-subrc EQ 0.
        APPEND fs TO itab.
        OPEN DATASET w_file2 FOR APPENDING IN TEXT MODE ENCODING DEFAULT. "Appending more data to the file in the
                                                           " application server
        TRANSFER fs TO w_file2.
        CLOSE DATASET w_file2.
      ELSE.
        EXIT.
      ENDIF.
    ENDDO.
    Regards
    Sarves

  • JSP read and write data in MS-SQL database

    I am new to JSP. I need to write JSP page to read and write data in MS-SQL Database. I wonder if it is different from other database. I couldn't find useful pointers in the web. Please advise. Thanks!!

    Sure, SQL Server is different from Oracle is different from MySQL is different from...
    But all of them can be accessed using JDBC:
    http://java.sun.com/docs/books/tutorial/jdbc/
    Maybe you should learn about that for starters.
    You can use SQL tags from JSTL in your JSPs. I'd recommend JSTL highly. No scriptlet code that way. - MOD

  • Upload data from excel into database through pl/sql

    Hi All,
    I have excel which contains data lets say employee details,
    I have one upload button ,which is used to upload excel and then i want to map the cell of excel to the database column and through plsql code i want to upload the excel data into database.
    In short ,i want to upload the data from excel into database using plsql code,
    or suggest me any other way to do this.(except the data load method present in apex)
    Thanks,
    Jitendra

    if you use APEX 4 you can define you own table
    the code below is for APEX 3
    PROCEDURE pro_carga_planilla_prosp( p_archivo VARCHAR2) IS
    v_blob_data BLOB;
    v_blob_len NUMBER;
    v_position NUMBER;
    v_raw_chunk RAW(10000);
    v_char CHAR(1);
    c_chunk_len number := 1;
    v_line VARCHAR2 (32767) := NULL;
    v_data_array wwv_flow_global.vc_arr2;
    v_rows number;
    v_sr_no number := 1;
    v_ok boolean := true;
    v_local_ok BOOLEAN := TRUE;
    v_reg_ok NUMBER := 0;
    v_reg_ko NUMBER := 0;
    v_localidad_id NUMBER;
    v_departamento_id NUMBER;
    v_cargo_id NUMBER;
    v_prospecto_id NUMBER;
    v_asesor_id NUMBER;
    V_REG prospectos%rowtype;
    BEGIN
    -- Read data from wwv_flow_files</span>
    select blob_content into v_blob_data
    from wwv_flow_files
    where name= p_archivo;
    v_blob_len := dbms_lob.getlength(v_blob_data);
    v_position := 1;
    -- Read and convert binary to char</span>
    WHILE ( v_position <= v_blob_len ) LOOP
    v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
    v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
    v_line := v_line || v_char;
    -- pro_log('linea '||v_line);
    v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved </span>
    IF v_char = CHR(10) THEN
    -- Convert comma to : to use wwv_flow_utilities </span>
    v_line := replace(REPLACE (v_line, ',', ':'), ';',':');
    v_line := replace(replace(v_line, chr(10)),chr(13));
    if substr(v_line,1,1)= ':' then
    v_line := '0'||v_line;
    end if;
    if instr(v_line,':',1,21) = 0 then
    if instr(v_line,':',1,20) = 0 then
    v_line:=v_line||':';
    end if;
    v_line:=v_line||':';
    end if;
    -- pro_log(v_line);
    -- Convert each column separated by : into array of data </span>
    v_data_array := wwv_flow_utilities.string_to_table (v_line);
    -- Insert data into target table </span>
    IF v_data_array(1) IS NOT NULL AND
    v_sr_no <> 1 THEN
    V_REG.NOMBRE:=ltrim(rtrim(v_data_array(2)));
    V_REG.RAZON_SOCIAL:=v_data_array(3);
    V_REG.DIRECCION := v_data_array(4)||' '||v_data_array(5);
    -- PRO_LOG('PROSP 1 ' ||v_sr_no);
    v_localidad_id := pack_empresas.get_localidad(v_data_array(6));
    -- PRO_LOG('PROSP 1.1 '||v_sr_no);
    V_REG.LOCALIDAD_ID:=v_localidad_id;
    -- PRO_LOG('PROSP 1.2 '||v_sr_no);
    V_REG.CODIGO_POSTAL:=LTRIM(RTRIM(v_data_array(7)) );
    -- PRO_LOG('PROSP 1.3 '||v_sr_no);
    -- PRO_LOG('PROSP 1.1 '||v_sr_no);
    v_departamento_id := pack_empresas.get_departamento(v_data_array(8));
    -- PRO_LOG('PROSP 1.4 '||v_sr_no);
    V_REG.DEPARTAMENTO_ID:=v_departamento_id;
    -- PRO_LOG('PROSP 1.5 '||v_sr_no);
    V_REG.TELEFONO:=v_data_array(9);
    --PRO_LOG('PROSP 1.6 '||v_sr_no);
    V_REG.TELEFONO2:=v_data_array(10);
    -- PRO_LOG('PROSP 1.7 '||v_sr_no);
    V_REG.RUBRO:=v_data_array(11);
    -- PRO_LOG('PROSP 1.8 '||v_sr_no);
    V_REG.RUC:=ltrim(rtrim(v_data_array(12)));
    -- PRO_LOG('PROSP 1.9 '||v_sr_no);
    -- pro_log(v_data_array(1));
    -- pro_log(v_data_array(2));
    V_REG.CANTIDAD_EMPLEADOS:=RTRIM(LTRIM(v_data_array(13)));
    -- PRO_LOG('PROSP 1.10 '||v_sr_no);
    -- pro_log(v_data_array(14));
    V_REG.CANTIDAD_BENEFICIARIOS:=RTRIM(LTRIM(v_data_array(14)));
    --PRO_LOG('PROSP 1.11 '||v_sr_no);
    V_REG.MAIL:=v_data_array(19);
    -- pro_log(V_REG.MAIL);
    -- PRO_LOG('PROSP 1.12 '||v_sr_no);
    -- v_data_array(20):= replace(replace(v_data_array(20),chr(10)),chr(13));
    if not v_data_array.exists(20) then
    -- pro_log('existe');
    -- pro_log(ltrim(rtrim(replace(replace(v_data_array(20),chr(10)),chr(13)))));
    V_REG.Proveedor:= ltrim(rtrim(replace(replace(v_data_array(20),chr(10)),chr(13))));
    else
    v_data_array(20):=null;
    end if;
    -- V_REG.PROVEEDOR:=v_data_array(20);
    -- PRO_LOG('PROSP 1.13 '||v_sr_no);
    if not v_data_array.exists(21) then
    V_REG.OBSERVACIONES:=v_data_array(21);
    else
    v_data_array(21):=null;
    end if;
    -- PRO_LOG('PROSP 1.14 '||v_sr_no);
    -- PRO_LOG('PROSP 1.2 '||v_sr_no);
    insert into prospectos (nombre,razon_social, direccion,localidad_id,codigo_postal,
    departamento_id, telefono, telefono2, rubro,ruc,cantidad_empleados,
    cantidad_beneficiarios,mail,proveedor,observaciones)
    values (nvl(ltrim(rtrim(v_data_array(2))),v_data_array(3)), v_data_array(3),
    v_data_array(4)||' '||v_data_array(5),
    v_localidad_id, LTRIM(RTRIM(v_data_array(7))),v_departamento_id, v_data_array(9),
    v_data_array(10),v_data_array(11), ltrim(rtrim(v_data_array(12))), RTRIM(LTRIM(v_data_array(13))),
    RTRIM(LTRIM(v_data_array(14))),v_data_array(19),v_data_array(20), v_data_array(21))
    returning prospecto_id INTO v_prospecto_id;
    -- PRO_LOG('PROSP 2');
    v_cargo_id := pack_empresas.get_cargo(v_data_array(17));
    -- PRO_LOG('PROSP 3');
    insert into prospecto_contactos (prospecto_id,nombre,apellido,cargo_id,
    telefono,mail)
    values (v_prospecto_id, nvl(v_data_array(15),'S/N'), nvl(v_data_array(16),'S/A'),
    v_cargo_id, v_data_array(18), v_data_array(19));
    -- PRO_LOG('PROSP 4');
    v_asesor_id := pack_empresas.get_asesor(v_data_array(1));
    -- PRO_LOG('PROSP 5');
    insert into asignaciones (prospecto_id,asesor_id,fecha_asignacion)
    values (v_prospecto_id, v_asesor_id, trunc(sysdate));
    -- PRO_LOG('PROSP 6');
    END IF;
    -- Clear out
    v_line := NULL;
    v_sr_no := v_sr_no + 1;
    END IF;
    END LOOP;
    delete wwv_flow_files
    where name= p_archivo;
    END pro_carga_planilla_prosp;
    function hex_to_decimal
    --this function is based on one by Connor McDonald
    --http://www.jlcomp.demon.co.uk/faq/base_convert.html
    ( p_hex_str in varchar2 ) return number
    is
    v_dec number;
    v_hex varchar2(16) := '0123456789ABCDEF';
    begin
    v_dec := 0;
    for indx in 1 .. length(p_hex_str)
    loop
    v_dec := v_dec * 16 + instr(v_hex,upper(substr(p_hex_str,indx,1)))-1;
    end loop;
    return v_dec;
    end hex_to_decimal;

  • How to reduce the run time of ABAP code (BADI) when it is reading huge data from BPC Cube and thus writing  back huge data to the cube.

    Hi All ,
    In Case of reading huge amount of record from BPC Cube  from BADI code , performing calculations and writing back huge amount of data into the cube , It takes lot of time . If there is any suggestion to read the data  from Cube  or writing data into the cube using some Parallel Processing  methods , Then Please suggest .
    Regards,
    SHUBHAM

    Hi Gersh ,
    If we have a specific server say 10.10.10.10 (abc.co.in) on which we are working, Then under RZ12 we make the following entry  as :
    LOGON GROUP          INSTANCE
    parallel_generators        abc.co.in_10         ( Lets assume : The instance number is 10 )
    Now in SM59 under ABAP Connections , I am giving the following technical settings:
    TARGET HOST          abc.co.in
    IP address                  10.10.10.10
    Instance number          10
    Now if we have a scenario of load balancing servers with following server details (with all servers on different instance numbers ) :
    10.10.10.11   
    10.10.10.13
    10.1010.10
    10.10.10.15
    In this case how can we make the RZ12 settings and SM59 settings such that we don't have to hardcode any IP Address.
    If the request is redirected to 10.10.10.11 and not to 10.10.10.10 , in that case how will the settings be.
    I have raised this question on the below thread :
    How to configure RZ12  and SM59 ABAP connection settings when we have work with Load Balancing servers rather than a specific server .
    Regards,
    SHUBHAM

  • APEX Application accessing data from two different databases

    Hi All,
    Currently as we all know that APEX Application resides in database and is connected to the schema of that database.
    I want APEX Application to be running and accessing data from two different databases. Elaborating my question,
    Currently, my APEX Production Application is connected with XXXX Schema of DB1 Database(Where APEX Resides). Now I want to add some pages into this APEX Application for REPORT Purpose, But I want to connect this REPORT APEX Pages to get data from Different Schema YYYY for Database DB2.
    Is it possible to configure this scenario?
    The reason for doing this is to avoid the REPORT related (adhoc queries) resource utilization effect on Production DB1 Database.
    Thanks
    Nil

    1. If you do the joining of two or more tables in DB1 then all data is pulled over to DB1 and then the join is executed: so more data over the databaselink and more work for DB1. Better keep the joining stuff where the data resides and just pull exactly that data over that you need.
    2. Don't know about your different block sizes. Seems a nice question for one of the other forums (DBA or SQL).
    3. I mean create synonyms on DB1 for reports VIEWS in DB2.
    Hope all is clear!

  • How can i save the data from the Oracle database to my local directory

    How can i save the data from the Oracle database to my local directory instead Of saving the data file to the Directory created on the Oracle Server ?
    I require to design the Procedure which will pull the data from various tables and needs to store the data in the Client's local directory.

    Since SQL*PLUS runs on the client, you can use SQL*PLUS to spool data to your local drive.
    You could also use the database to write a a specified drive where all users have access to (mapped network drive, e.g.). I wouldn't recommend doing it that way, but it is sometimes useful when the files are created in some nightly batch run.

  • Populate a table reading the data from a TXT file

    how can I populate a table reading the data from a TXT file?
    thanks

    Hey Kevin!
    Using FORMS.TEXT_IO to bulk load data from a file strikes me as re-inventing the wheel. It is just about justifiable in a self-service environment, but I regard the EXTERNAL TABLE is a better solution for that situation as well.
    The same applies to UTL_FILE. I think the ability to read text with UTL_FILE is primarily intended for read file-based configuration or file manipulation/processing rather than data loading.
    Re-writing a text file into SQL statements is too much like hard work (even with an editor that supports macro definition and regular expressions) for no real benefit. You lose all the bulk load peformance you would get from SQL*Loader. But for QAD I'd probably let you off with it.
    You missed out one obvious alternative: using Java to turn the contents of an XML file into a CLOB and inserting it into a table which is read by a PL/SQL procedure that parses the XML records and insert the retrieved data into a table.
    Stay lucky, APC

  • Query data from MS SQL db through Oracle ? By using JAVA ?

    Hi folks,
    I would like to sync our one table in oracle db with table in different system, stored in MS SQL database.
    What would be the easiest option for connection from Oracle to MS SQL db to be able to query data from MS SQL through some Oracle package?
    If possible, I would like to keep all "tricky steps" within Oracle database. I heard about option with Java, but so far we have no experience with java in Oracle.
    Our database: Oracle 11g Database Standard Edition One
    Many thanks,
    Tomas

    C:\Users\tomeo>dg4pwd HELIOS
    ORACLE Gateway Password Utility
    Constructing password file for Gateway SID HELIOS
    For user account SYSTEM
    OPW-00001: Unable to open password-file (RC=0)
    C:\Users\tomeo>

  • How to replicate data from MS SQL Server  to Oracle

    Hi,
    Can someone please help me on how to replicate data from MS SQL Server to Oracle 8i database.

    Dear,
    I'm a student.
    I do simple replication on Oracle 8.0.5 successfully. (one master site and one snapshot site). I only use the SQL*Plus and Schema Manager to do.
    But when I do advance replication (multimaster replication) I meet many problem. So I don't get the result.
    Do you show me the technology to do that ?
    Thanks !

  • Display images from a SQL database

    I want to display images from a SQL database. The images are in a table under a specific column and are stored as a link to the image. How would I display the images from the column in LabVIEW?
    I'm using LabVIEW 2013 version 13 and SQL Server 2012
    Paul Power
    I have not lost my mind, it's backed up on a disk somewhere

    Hi PauldePaor,
    I hope you are well.
    Once you have pulled the data from the database into LabVIEW in a string form (or path), you can simply use the Read BMP File (Or jpg, png depending on the file type) VI.
    More information can be found here:
    http://digital.ni.com/public.nsf/allkb/02971A30F5D8FC6986256A0A004F11A0
    Kind Regards,
    Aidan H
    Applications Engineer
    National Instruments UK & Ireland

Maybe you are looking for

  • Can't scan to email on printer or transfer pictures ad files to email on computer

    I've tried and tried to fix in Default Program - cannot put anything in and cannot find email in it.Everyte I try to transfer pictures or files as an attachment to email, It comes  up - no email prgram-repair it Default Programs - can't remember all

  • How to find out the "manufacture date"?

    Hello! Can you tell me how to find out the manufacture date of my Satellite A110-334 with the serial "SY6224123K"? I need this information for my insurance! I found only this link for HDD`s: http://www.storage.toshiba.eu/index_manual.php?pid=220&sid=

  • Iphoto 9.6 Pictures Gone

    I recently upgraded to Iphoto 9.6 on Yosemite. When I open Iphoto all my pictures are gone. When I look in "finder" I can see the file called "Iphoto library" and it still shows that I have 18GB of photos in that file. However when I try to import th

  • My contact list does not show all my contacts.

    My contact list does not show all my contacts.  If I keypad a number not shown in the contacts it does know who that contact is.  What can I do to show all contacts?  I have 352 contacts in the phone.

  • Webservices in BPM10g and SOA Suite11g

    Dear Friends / Gurus - Now I'm working on BPM 10g and PAPI-WS (and I know that, 10g also having Process as Webservice implementations) But blocked on PAPI-WS Object mappings on arguments, and I'm sure that 11g having some good and advanced implementa