Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

sqlDataAdapter Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
joseph micheli - 11 Aug 2005 01:36 GMT
I have the following code attached to the click event of a button.  It fails
on the line "da.Fill (ds, "Results")  The error is below the code.  Any
suggestions would be greatly appreciated.  Thanks.

Dim cmd As SqlCommand = SqlConnection1.CreateCommand
       cmd.CommandType = CommandType.Text
       cmd.CommandText = txtQuery.Text
       Dim da As SqlDataAdapter = New SqlDataAdapter
       da.SelectCommand = cmd
       Dim ds As DataSet = New DataSet
       da.Fill(ds, "Results")
       dgResults.DataSource = ds
       dgResults.DataMember = "Results"

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred
in system.data.dll

Additional information: System error.
Signature

Joe Micheli CPA, CMA, CFM, CPIM

FPM - 16 Aug 2005 20:46 GMT
hi joseph,

I think that the first thing you should do is to enclose your
'da.Fill(ds,"Results")'-statement in a try-catch-block. In that way you can
catch the exception and examine it more closely. The exception should give
more insight on what is causing the error.

Frank.

> I have the following code attached to the click event of a button.  It fails
> on the line "da.Fill (ds, "Results")  The error is below the code.  Any
[quoted text clipped - 14 lines]
>
> Additional information: System error.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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



©2008 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.