Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics 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 June 5th, 2005, 06:31 AM
Authorized User
 
Join Date: Oct 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ado.Net Error

I'm trying to get to grips with ado.net under vb.net. Below I've included a rather simple piece of code which is producing a run time error on line 18. The error message produced is.

"An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in microsoft.visualbasic.dll

Additional information: System error."

Imports System
Imports System.Data
Imports System.Data.SqlClient

Module Module1

    Sub Main()

        Dim Conn = New SqlConnection("Data Source=P2000;Initial Catalog=Northwind;Integrated Security=SSPI")
        Dim rdr As SqlDataReader

        Conn.open()

        Dim cmd = New SqlCommand("select * from cutomers", Conn)



        rdr = cmd.ExecuteReader()

    End Sub

End Module
 
Old June 5th, 2005, 06:33 AM
Authorized User
 
Join Date: Oct 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry left the line numbers off!!

Line 18 is:

 rdr = cmd.ExecuteReader()

Thanks
 
Old June 7th, 2005, 04:29 AM
Authorized User
 
Join Date: Oct 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Found the answer. It was deeply technical !!!

I spell "Customers" wrong!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
ADO.NET error gb012993 BOOK: Beginning C# 2005 Databases 2 May 9th, 2007 03:10 AM
Difference between ADO and ADO.NET rakeshclose2u ADO.NET 2 April 23rd, 2007 03:57 AM
ADO AND ADO.NET royalsurej ADO.NET 1 November 8th, 2004 08:28 AM
Beginning ASP.NET E-Commerce (ADO error) dianastudy3 All Other Wrox Books 3 July 30th, 2003 11:51 PM
MSDE and SQL CE (using VB.NET and ADO.NET) LEGS ADO.NET 0 July 12th, 2003 11:27 AM





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