473,837 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help With OleDbDataAdapte r

hi all(i tried yesterday but it didnt work).
i wrote this code and i get an error msg:
Private Pr_MyCon As System.Data.Ole Db.OleDbConnect ion
Private Pr_DataSet As DataSet
Private Pr_DataAdapter As
System.Data.Ole Db.OleDbDataAda pter
Pr_MyCon = New System.Data.Ole Db.OleDbConnect ion
Pr_DataSet = New DataSet("Temp")
Pr_MyCon.Connec tionString = "..."
Pr_DataAdapter = New OleDb.OleDbData Adapter("select *
from MyTable", Pr_MyCon)
Pr_DataAdapter. Fill(Pr_DataSet , "MyTable")
the error msg saing:"An unhandled exception of
type 'System.Data.Ol eDb.OleDbExcept ion' occurred in
system.data.dll "
Nov 21 '05 #1
4 3991
Hello

You could try this, only you will need to change Connection string and Table
name

Dim Pr_MyCon As System.Data.Ole Db.OleDbConnect ion
Dim Pr_DataSet As DataSet
Dim Pr_DataAdapter As System.Data.Ole Db.OleDbDataAda pter
Pr_MyCon = New System.Data.Ole Db.OleDbConnect ion
Pr_DataSet = New DataSet("Temp")
Pr_MyCon.Connec tionString = "Provider=SQLOL EDB.1;Integrate d
Security=SSPI;P ersist Security Info=False;User ID=ppr;Initial
Catalog=BMS;Dat a Source=SERVER1"
Pr_DataAdapter = New OleDb.OleDbData Adapter("select * from CUSTOMER",
Pr_MyCon)
Pr_DataAdapter. Fill(Pr_DataSet , "MyTable")

Regards

Partha

"shachar" <an*******@disc ussions.microso ft.com> wrote in message
news:28******** *************** *****@phx.gbl.. .
hi all(i tried yesterday but it didnt work).
i wrote this code and i get an error msg:
Private Pr_MyCon As System.Data.Ole Db.OleDbConnect ion
Private Pr_DataSet As DataSet
Private Pr_DataAdapter As
System.Data.Ole Db.OleDbDataAda pter
Pr_MyCon = New System.Data.Ole Db.OleDbConnect ion
Pr_DataSet = New DataSet("Temp")
Pr_MyCon.Connec tionString = "..."
Pr_DataAdapter = New OleDb.OleDbData Adapter("select *
from MyTable", Pr_MyCon)
Pr_DataAdapter. Fill(Pr_DataSet , "MyTable")
the error msg saing:"An unhandled exception of
type 'System.Data.Ol eDb.OleDbExcept ion' occurred in
system.data.dll "

Nov 21 '05 #2
NO, i copied your code and i get the same error msg.
-----Original Message-----
Hello

You could try this, only you will need to change Connection string and Tablename

Dim Pr_MyCon As System.Data.Ole Db.OleDbConnect ion
Dim Pr_DataSet As DataSet
Dim Pr_DataAdapter As System.Data.Ole Db.OleDbDataAda pter
Pr_MyCon = New System.Data.Ole Db.OleDbConnect ion
Pr_DataSet = New DataSet("Temp")
Pr_MyCon.Conne ctionString = "Provider=SQLOL EDB.1;Integrate dSecurity=SSPI; Persist Security Info=False;User ID=ppr;InitialCatalog=BMS;Da ta Source=SERVER1"
Pr_DataAdapt er = New OleDb.OleDbData Adapter("select * from CUSTOMER",Pr_MyCon)
Pr_DataAdapter .Fill(Pr_DataSe t, "MyTable")

Regards

Partha

"shachar" <an*******@disc ussions.microso ft.com> wrote in messagenews:28******* *************** ******@phx.gbl. ..
hi all(i tried yesterday but it didnt work).
i wrote this code and i get an error msg:
Private Pr_MyCon As System.Data.Ole Db.OleDbConnect ion
Private Pr_DataSet As DataSet
Private Pr_DataAdapter As
System.Data.Ole Db.OleDbDataAda pter
Pr_MyCon = New System.Data.Ole Db.OleDbConnect ion
Pr_DataSet = New DataSet("Temp")
Pr_MyCon.Connec tionString = "..."
Pr_DataAdapter = New OleDb.OleDbData Adapter("select *
from MyTable", Pr_MyCon)
Pr_DataAdapter. Fill(Pr_DataSet , "MyTable")
the error msg saing:"An unhandled exception of
type 'System.Data.Ol eDb.OleDbExcept ion' occurred in
system.data.dll "

.

Nov 21 '05 #3
Hello

I used the same code to bind to a datagrid.
The code below is working.
Dim Pr_MyCon As System.Data.Ole Db.OleDbConnect ion

Dim Pr_DataSet As DataSet

Dim Pr_DataAdapter As System.Data.Ole Db.OleDbDataAda pter

Pr_MyCon = New System.Data.Ole Db.OleDbConnect ion

Pr_DataSet = New DataSet("Temp")

Pr_MyCon.Connec tionString = "Provider=SQLOL EDB.1;Integrate d
Security=SSPI;P ersist Security Info=False;User ID=ppr;Initial
Catalog=BMS;Dat a Source=APHRODIT E"

Pr_DataAdapter = New OleDb.OleDbData Adapter("select * from CUSTOMER",
Pr_MyCon)

Pr_DataAdapter. Fill(Pr_DataSet , "MyTable")

Me.DataGrid1.Se tDataBinding(Pr _DataSet, "MyTable")
Regards
Partha

"shachar" <an*******@disc ussions.microso ft.com> wrote in message
news:1a******** *************** *****@phx.gbl.. .
NO, i copied your code and i get the same error msg.
-----Original Message-----
Hello

You could try this, only you will need to change

Connection string and Table
name

Dim Pr_MyCon As System.Data.Ole Db.OleDbConnect ion
Dim Pr_DataSet As DataSet
Dim Pr_DataAdapter As System.Data.Ole Db.OleDbDataAda pter
Pr_MyCon = New System.Data.Ole Db.OleDbConnect ion
Pr_DataSet = New DataSet("Temp")
Pr_MyCon.Conne ctionString

= "Provider=SQLOL EDB.1;Integrate d
Security=SSPI; Persist Security Info=False;User

ID=ppr;Initial
Catalog=BMS;Da ta Source=SERVER1"
Pr_DataAdapt er = New OleDb.OleDbData Adapter("select *

from CUSTOMER",
Pr_MyCon)
Pr_DataAdapter .Fill(Pr_DataSe t, "MyTable")

Regards

Partha

"shachar" <an*******@disc ussions.microso ft.com> wrote in

message
news:28******* *************** ******@phx.gbl. ..
hi all(i tried yesterday but it didnt work).
i wrote this code and i get an error msg:
Private Pr_MyCon As System.Data.Ole Db.OleDbConnect ion
Private Pr_DataSet As DataSet
Private Pr_DataAdapter As
System.Data.Ole Db.OleDbDataAda pter
Pr_MyCon = New System.Data.Ole Db.OleDbConnect ion
Pr_DataSet = New DataSet("Temp")
Pr_MyCon.Connec tionString = "..."
Pr_DataAdapter = New OleDb.OleDbData Adapter("select *
from MyTable", Pr_MyCon)
Pr_DataAdapter. Fill(Pr_DataSet , "MyTable")
the error msg saing:"An unhandled exception of
type 'System.Data.Ol eDb.OleDbExcept ion' occurred in
system.data.dll "

.

Nov 21 '05 #4
Shachar,

To get more information you can try this

The code you use cannot be, therefore I assume that the private declaration
are outside a method and the rest in it.

Private Pr_MyCon As System.Data.Ole Db.OleDbConnect ion
Private Pr_DataSet As DataSet
Private Pr_DataAdapter As
System.Data.Ole Db.OleDbDataAda pter

Method sub or function
Pr_MyCon = New System.Data.Ole Db.OleDbConnect ion
Pr_DataSet = New DataSet
Pr_MyCon.Connec tionString = "..."
Pr_DataAdapter = New OleDb.OleDbData Adapter("select *
from MyTable", Pr_MyCon)
try
Pr_DataAdapter. Fill(Pr_DataSet , "MyTable")
catch ex as oledb.oledbexce ption
messagebox.show (ex.tostring)
catch ex as exception
end try
///
above typed in this message not tested and maybe with typos.

With this you get more information from the problem.
I assume it is a windowform application otherwise you should use the
console.write when you use VSNet or an extra label to show the ex.message on
a page when you use the notebook.

I hope this helps?

Cor
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2116
by: Joey Liang via DotNetMonster.com | last post by:
Hi all, I am new in asp.net, i encounter some problems in using drop down list and datagrid. I have manage to bind the data into datagrid but i wanted to bind the data into the datagrid accroding to the selected brand from the drop down list. I do not have any idea how to do it. Does anyone knows how to bind the data in to datagrid accroding to the drop down list selected item? if there is a way would u mind paste the code or any...
6
2029
by: Joey Liang via DotNetMonster.com | last post by:
Hi all, I have a drop down list which store all the different brands of product.When i selected the particular brand from the drop down list, it will display all the products with the selected brand in a datagrid. I have this error when i select a brand from the drop down list. Blow is my code,anyone can help me to solve my error,which part of my code went wrong? Really thanx and very appreciate your help in advanced.. I have been stucked...
1
1005
by: Chris Kettenbach | last post by:
Hi All, Quick question. Can I use more than two tables as a source for a dataset? I am trying to fill a dataadpater but when I include more than two tables, it bombs out. Example: ________________________________________________________ This works cmd = New OleDbCommand("SELECT FirstName, LastName " & _ "FROM (Event_Registration INNER JOIN Employees ON " & _ "Event_Registration.EmployeeID = Employees.EmployeeID) " & _ "WHERE...
3
1413
by: steve | last post by:
Hello, I have been trying to populate 2 or more controls from two *different* (related) tables for the last week without success. My latest try is: 2 simple SELECT statements in 2 adapters that populate the *same* dataset and then i define a relation among the two tables. SIMPLE!!!!!!! Everything works fine but the controls from different tables are NOT synchronised. Am I doing something wrong or this is the wrong way altogether to...
2
1528
by: Allen | last post by:
Hey all, I have a question for you all. I'm learning vb.net and need some help. I have two classes one named Customers and one named CustomersDA. I have to go though Customer for everything. I have a listbox that needs to get data from an array. I call a function called GetAll that is a ArrayList in Customers that then calls CustomersDA.GetAll that is also an array list but returns customers (see code below).I need to fill a listbox from...
1
1452
by: ROBERT BEE | last post by:
Below is some code I have copied from the web with the intention of modifying but I keep getting the stated errors. This is the umpteenth attempt at trying to get OleDbConnection,OleDbDataAdapter to work without any success. Do the references have a hierarchy like in vb6 or is there something else I am missing? Many Thanks in advance
0
1065
by: Guy W via DotNetMonster.com | last post by:
I read and tried to use the repeater paging method I found on 4 Guys from Rolla (I've tried others also) but it doesn't seem to work. Please see the code I have below and tell me what I may be doing wrong. I'm using Visual Studio with SQL 2000. This is question/answer page that loads questions & answers dynamically. I would like to present 1 question at a time instead of all questions on one page as quizzes may have up to 50 questions. ...
2
1924
by: momo | last post by:
Hello Guys, I have a bit of a problem, I created a Dll called SecureQueryStringDll.dll and I had the dll put bin folder of my application first and it did not work so I then put it in the bin folder of c:\inetpub\wwwroot and it still does not work. Here is the error I get from it: temporary asp.net files\root\d16a94c5\8b912d73\assembly\dl2\1dc1ef5c\006575a4_827ac301\metabuilders.webcontrols.rowselectorcolumn.dll"...
0
1152
by: adnan1888 | last post by:
i want to display some data in a grid but this is the error i get. withEvents variable 'DataGrid1' implicitly defines '_DataGrid1', which conflicts with a member of the same name in class 'mastersearch'. i tried renaming the variables but that does not help because it EITHER doesnt bind the data at all OR does bind it but doesnt trigger the page change event this is the code if it helps thanks in advance
0
9843
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10566
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10623
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7806
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7001
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5848
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3124
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.