Results 1 to 6 of 6

Thread: Db2 & Datagrid

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    9

    Db2 & Datagrid

    Hi,

    I need to populate the search results from a DB2 table into the datagrid..Can someone help me with this?

    my connection is as shown below..

    Dim cString As String = "Provider=IBMDADB2.1;Password=" + sPW + ";User ID=" + sUID + ";Data Source=" + sDS + ";Connect Timeout=45"

    Dim cn As OleDbConnection
    cn = New OleDbConnection()
    cn.ConnectionString = cString
    cn.Open()

    I am trying to use OleDbDataAdapter,OleDbCommand,DataSet to load the datagrid with the search results.

    Please some one help me!

    Thanx a Bunch in Advance.

  2. #2
    Lively Member
    Join Date
    Aug 2002
    Location
    outerspace
    Posts
    126
    Im thinking u want something like this

    Dim cn as new oledb.connection(yourconnection)
    Dim blah as New OleDb.OleDbDataAdapter(sqlstatemnet,cn)
    Dim ds as new dataset
    blah.fill(ds)
    datagrid1.datasource = ds
    datagrid1.databind
    "All those who wonder are not lost" -j.r.r tolkien

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    9

    db2 & Datagrid

    An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

    I get the above error on

    cn.Open()

  4. #4
    Lively Member
    Join Date
    Aug 2002
    Location
    outerspace
    Posts
    126
    you dont need to use connection open on the senario I coded out above its connectionless.
    "All those who wonder are not lost" -j.r.r tolkien

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    9
    sorry to bug u, but now i have the error on

    An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

    blah.fill(ds)

    can u please clear this error?

    Thanx.

  6. #6
    Lively Member
    Join Date
    Aug 2002
    Location
    outerspace
    Posts
    126
    Im thinking that the error message should be more descriptive is there any other information being contained in your error message also have u test to make sure your db2 dataprovider is installed and works in other instances? just some things to check
    "All those who wonder are not lost" -j.r.r tolkien

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