Results 1 to 3 of 3

Thread: Error in DATA Adapter

  1. #1

    Thread Starter
    Fanatic Member khalik_ash's Avatar
    Join Date
    Aug 2002
    Location
    Singapore
    Posts
    724

    Error in DATA Adapter

    i am fill datase with more than one Data Adapterit works fine with one and when the second fill method is executed i get a error "Object Instance is not Set to the Instance of the Object"

    what can be wrong...

    Code:
    Public Ds_ORG As DataSet = New DataSet()
    
        Public Sub Init_DataSet()
            Try
                Dim OIT_User_SelectCmd As New SqlClient.SqlCommand("select * from OIT_User", Cn)
                Dim OIT_User_Adapter As SqlClient.SqlDataAdapter
    
                Dim OIT_Permissions_SelectCmd As New SqlClient.SqlCommand("select * from OIT_Permissions", Cn)
                Dim OIT_Permissions_Adapter As SqlClient.SqlDataAdapter
    
                Dim OIT_Folder_SelectCmd As New SqlClient.SqlCommand("select Rec_ID,Folder_Name,Folder_Parent,Folder_Type,Icon_rec_id,IsRecycle,Old_Parent_Folder,User_Created from OIT_FOLDER where (ISTEMPLATE<>1) ", Cn)
                Dim OIT_Folder_Adapter As New SqlClient.SqlDataAdapter()
    
                Dim OIT_File_SelectCmd As New SqlClient.SqlCommand("select Rec_Id  , File_Name ,Folder_Rec_ID, File_DateUploaded,File_DateLastOpened, File_DateDownloaded,File_Description,File_TotalBytes,File_UserUploaded from oit_file where IsRecycle=0", Cn)
                Dim OIT_File_Adapter As SqlClient.SqlDataAdapter
    
                OIT_Folder_Adapter.SelectCommand = OIT_Folder_SelectCmd
                OIT_Folder_Adapter.Fill(Ds_ORG, "OIT_Folder")
    
    '-----------------problem area------------------
                OIT_File_Adapter.SelectCommand = OIT_File_SelectCmd
                OIT_File_Adapter.Fill(Ds_ORG, "(OIT_File)")
    
                'OIT_User_Adapter.SelectCommand = OIT_User_SelectCmd
                'OIT_User_Adapter.Fill(Ds_ORG, "OIT_User")
    
                'OIT_Permissions_Adapter.SelectCommand = OIT_Permissions_SelectCmd
                'OIT_Permissions_Adapter.Fill(Ds_ORG, "OIT_Permissions")
    
            Catch e As Exception
                MsgBox(e.Message)
            End Try
        End Sub

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    VB Code:
    1. Dim OIT_Permissions_Adapter As SqlClient.SqlDataAdapter
    2. Dim OIT_User_Adapter As SqlClient.SqlDataAdapter
    3. Dim OIT_File_Adapter As SqlClient.SqlDataAdapter
    should be
    VB Code:
    1. Dim OIT_Permissions_Adapter As [B]New[/B] SqlClient.SqlDataAdapter
    2. Dim OIT_User_Adapter As [B]New[/B] SqlClient.SqlDataAdapter
    3. Dim OIT_File_Adapter As  [B]New[/B] SqlClient.SqlDataAdapter
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    Fanatic Member khalik_ash's Avatar
    Join Date
    Aug 2002
    Location
    Singapore
    Posts
    724
    well i knew i have missed some thing simple.. ofcourse New is not that simple..... thanks a lot Lunatic3

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