Results 1 to 4 of 4

Thread: (2005) data transfare

Threaded View

  1. #1

    Thread Starter
    Member GARAKWAZVO's Avatar
    Join Date
    Mar 2007
    Location
    Zimbabwe
    Posts
    56

    Red face (2005) data transfare

    Guys im getting an err msg (dataset can't be null)from the following code can somebody help. I want to expot my data from oracle to sql using my code. most wellcome will be suggestions to the code
    vb Code:
    1. conn.Open()
    2.             'collecting from a database
    3.             gerry = "SELECT STTM_CUST_PERSONAL.FIRST_NAME, STTM_CUST_ACCOUNT.CUST_AC_NO, STTM_CUST_ACCOUNT.ADDRESS1, STTM_CUST_ACCOUNT.ADDRESS2, STTM_CUST_ACCOUNT.ADDRESS3, STTM_CUST_ACCOUNT.ADDRESS4, STTM_CUST_PERSONAL.TELEPHONE, STTM_CUST_PERSONAL.LAST_NAME, STTM_CUST_PERSONAL.FAX, STTM_CUSTOMER.COUNTRY, STTM_CUST_PERSONAL.E_MAIL FROM STTM_CUST_ACCOUNT, STTM_CUSTOMER, STTM_CUST_PERSONAL WHERE STTM_CUSTOMER.FROZEN='N' AND STTM_CUSTOMER.DECEASED = 'N' AND STTM_CUSTOMER.WHEREABOUTS_UNKOWN = 'N'AND STTM_CUST_ACOUNT.CUST_NO = STTM_CUSTOMER.CUSTOMER_NO AND STTM_CUSTOMER.CUSTOMER_NO = STTM_CUST_PERSONAL.CUSTOMER_NO"
    4.             da = New OracleDataAdapter(gerry, conn)
    5.             da.Fill(ds, "gerry1")
    6.             'FILLING THE NEW DATABASE
    7.             myConnection.Open()
    8.             myCommand = New SqlCommand("INSERT INTO accounts (FIRST_NAME, LAST_NAME, CUST_AC_NO, ADDRESS1, ADDRESS2, ADDRESS3, ADDRESS4, TELEPHONE, FAX, COUNTRY, E_MAIL) VALUES (gerry1.FIRST_NAME, gerry1.LAST_NAME, gerry1.CUST_AC_NO, gerry1.ADDRESS1, gerry1.ADDRESS2, gerry1.ADDRESS3, gerry1.ADDRESS4, gerry1.TELEPHONE, gerry1.FAX, gerry1.COUNTRY, gerry1.E_MAIL)", myConnection)
    9.             ra = myCommand.ExecuteNonQuery()
    10.             MessageBox.Show("Records transfered" & ra)
    11. myconnection.close()
    12. conn.close()
    Last edited by si_the_geek; Apr 10th, 2007 at 09:34 AM. Reason: added vbcode tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width