|
-
Mar 28th, 2003, 06:55 AM
#1
Thread Starter
Fanatic Member
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
-
Mar 28th, 2003, 07:19 AM
#2
Frenzied Member
VB Code:
Dim OIT_Permissions_Adapter As SqlClient.SqlDataAdapter
Dim OIT_User_Adapter As SqlClient.SqlDataAdapter
Dim OIT_File_Adapter As SqlClient.SqlDataAdapter
should be
VB Code:
Dim OIT_Permissions_Adapter As [B]New[/B] SqlClient.SqlDataAdapter
Dim OIT_User_Adapter As [B]New[/B] SqlClient.SqlDataAdapter
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
-
Mar 29th, 2003, 12:08 AM
#3
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|