|
-
Nov 18th, 2002, 11:50 AM
#1
Thread Starter
New Member
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.
-
Nov 18th, 2002, 12:14 PM
#2
Lively Member
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
-
Nov 18th, 2002, 12:22 PM
#3
Thread Starter
New Member
db2 & Datagrid
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
I get the above error on
cn.Open()
-
Nov 18th, 2002, 12:33 PM
#4
Lively Member
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
-
Nov 18th, 2002, 01:31 PM
#5
Thread Starter
New Member
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.
-
Nov 18th, 2002, 03:48 PM
#6
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|