Results 1 to 3 of 3

Thread: Exception occure when use datagrid to present Data from database

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    5

    Exception occure when use datagrid to present Data from database

    Hello,
    I'm new comer to VB.NET, I'm trying to write a simple form, use datagrid to present data from a DataSet. I use only one table in dataset, and I can preview full data in sqlDataAdapter, as I desire, at design time. In the form I have a "View" button allow display full data selected from database in datagrid at runtime, the code for click event as follow:

    Private Sub cmdView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdView.Click
    Area.Clear()
    SqlDataAdapter_Area.Fill(Area, "Area")
    End Sub

    In that: "Area" is dataset's name, and "SQLDataAdapter_Area" is DataAdapter's name of dataset Area

    It's seem nothing wrong at design time but at the runtime when I click button "View", I got an exception like that:

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

    I don't understand this message, can you tell me ?
    Thanks in advance
    Last edited by www; Jul 28th, 2002 at 11:06 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width