Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2004, 09:52 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Can we see an example of the code that is giving you these results?
 
Old March 3rd, 2004, 10:04 AM
Registered User
 
Join Date: Mar 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default All I get is System._ComObject

I'm new to ADO.NET so hopefully this problem will be easy for you lot.

I'be upgraded a VB6 project that uses standard ADO to .NET. I knew there would be upgrade issues, but I didn't mind 'cos I thought it would a good starting point.

I started by simply including the ADODB object so I didn't have to modify this code too much, but every field that I field from the recordset returns System._ComObject.

I concluded that it must be an issue with the old ADO and VB.NET. Sadly after slowly re-writing the code as ADO.NET i still get the same result - System._ComObject.

I think strictly speaking that the problem must have more to do with VB.NET rather that ADO.NET, but I'm hopeing this problem seems familiar to someone.

Cheers,
Mark
 
Old March 4th, 2004, 05:53 AM
Registered User
 
Join Date: Mar 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Public gazConnection As New SqlConnection
Public gazRecordSet As SqlDataReader

gazConnection.ConnectionString = "SERVER=SQUEEL;" & _
    "Initial Catalog=CityGaz;User Id=citygaz;" & _
    "Password=citygaz"
gazConnection.Open()

'Open recordset as per SQL
Dim cmd As New SqlCommand(mySQL)
gazRecordSet = cmd.ExecuteReader(CommandBehavior.CloseConnection)

Do While gazRecordSet.Read()
     myString = gazRecordSet("address")
Loop

This is the jist of it.
Cheers,
Mark
 
Old March 4th, 2004, 10:22 AM
Registered User
 
Join Date: Mar 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After buying a rather chunky text book, I've added a few lines of code that appears in it's examples. I'm sure of their significance right now, but they seem to do the trick. Everything is fine now.

Thanks to anyone who's trying to help, but it's sorted!

Cheers,
Mark
 
Old June 14th, 2005, 04:11 AM
Authorized User
 
Join Date: Jun 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there (Mark)!

I'm having the same problem, does anyone have a solution. THANKS!!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
System.InvalidCastException; System.Reflection.Tar Jophie BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 January 16th, 2008 03:29 PM
system.stackoverflowexception in system.windows.fo scheidel21 Pro VB.NET 2002/2003 2 May 18th, 2007 12:40 AM
Insert System date and System Time -Form _TextBox cnkumar74 VB How-To 14 February 14th, 2007 10:52 AM
Accessing System Resources of a Remote System harsh_hot J2EE 0 February 9th, 2006 01:13 AM
Casting System::Object __gc * to System.Double[] nepsat Visual C++ 3 November 19th, 2005 12:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.