Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / October 2006



Tip: Looking for answers? Try searching our database.

DataSets in Console Applications

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KellyLeia@gmail.com - 26 Oct 2006 16:22 GMT
I'm trying to rewrite a console application from VB6 to .Net 2005 that
moves users and computer about in active directory.  To start, its
grabs current users from our AS400 box and throws them into a table in
SQL.  It then queries SQL and Active Directory, compares, and
adds/updates/removes users.  What i'm trying to do here is just open up
a dataset and connect to the AD table.  When i run this, it throws the
error "91, ADSynch, Object reference not set to an instance of an
object."  I threw this code into a datagrid, adding the datasource and
databind methods, and it works fine, showing everything.  Is there
something special I need to do to make datasets work in consoles?

Dim strSQL As String = "SELECT * FROM ADV_setAD"
Dim objConnection As SqlConnection = New SqlConnection(strConnString)
Dim dsDataSet As New DataSet
Dim daDataAdapter As SqlDataAdapter = New SqlDataAdapter(strSQL,
objConnection)
Dim r As DataRow
Dim dt As New DataTable("AD")
daDataAdapter.Fill(dsDataSet, "AD")
objConnection.Dispose()
daDataAdapter.Dispose()

       'Check if CN is null, then the user is new a needs to be
created.
       For Each r In dsDataSet.Tables("AD").Rows
           'store current ads path
           strAdspath = r("stored_adspath")
           ''''more code here that doesn't really execute because
there's no records to act upon.
Ralph - 26 Oct 2006 16:43 GMT
> I'm trying to rewrite a console application from VB6 to .Net 2005 that
> moves users and computer about in active directory.  To start, its
[quoted text clipped - 25 lines]
>             ''''more code here that doesn't really execute because
> there's no records to act upon.

You need to re-post to a dotNet newsgroup to get a wider audience of people
who use it. This news group is populated by programmers who use classic VB
(VB6 and below) and ADO (not ADO.Net, which is a very different critter).

Try...
news://msnews.microsoft.com/
  microsoft.public.dotnet.languages.vb
  microsoft.public.dotnet.languages.vb.data
  microsoft.public.dotnet.framework.adonet

-ralph
KellyLeia@gmail.com - 26 Oct 2006 16:55 GMT
Sorry.  My brain's spontaneously combusting from trying every possible
solution.  Thanks!!

> <KellyL...@gmail.com> wrote in messagenews:1161876141.427106.52680@e3g2000cwe.googlegroups.com...
>
[quoted text clipped - 37 lines]
>
> -ralph- Hide quoted text -- Show quoted text -
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.