473,408 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to Access Data Using Query?

Hi All,

I am new to VB.Net and am having a problem with the below code. I am
trying to fill in a datagrid with the below query but it keeps giving
me error where the *'s are located below. I have an OleDbDataAdapter,
OleDbConnection and DataSet on my form.

This is the actual error:
An unhandled exception of type 'System.Data.OleDb.OleDbException'
occurred in system.data.dll
Thanks
Mathew
Private Sub frmGetData_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim result
OleDbDataAdapter1.SelectCommand.CommandText = "SELECT
JobTitle, PrimaryJob.* FROM PrimaryJob WHERE JobTitle ='" & gStrTitle
& "'"
ProdDataSet.Clear()
*** OleDbDataAdapter1.Fill(ProdDataSet)***
End Sub
Nov 20 '05 #1
2 1028
Cor
Hi Sasha,

The most simple things to find a problem yourself is:
Use a try catch end try block
Narrow your problem down.

In this case you can start with this narrow it down.
You know you have everything done, but your select statement can be the
bottleneck.
Try that first with

Select * from PrimaryJob

Is that working than you know your problem, if not than it is outside the
code you provided.
(and if it is working you can add piece by piece to your select)

I hope this helps?

Cor
I am new to VB.Net and am having a problem with the below code. I am
trying to fill in a datagrid with the below query but it keeps giving
me error where the *'s are located below. I have an OleDbDataAdapter,
OleDbConnection and DataSet on my form.

This is the actual error:
An unhandled exception of type 'System.Data.OleDb.OleDbException'
occurred in system.data.dll
Thanks
Mathew
Private Sub frmGetData_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim result
OleDbDataAdapter1.SelectCommand.CommandText = "SELECT
JobTitle, PrimaryJob.* FROM PrimaryJob WHERE JobTitle ='" & gStrTitle
& "'"
ProdDataSet.Clear()
*** OleDbDataAdapter1.Fill(ProdDataSet)***
End Sub

Nov 20 '05 #2
* ma*****@aecl.ca (Sasha) scripsit:
This is the actual error:
An unhandled exception of type 'System.Data.OleDb.OleDbException'
occurred in system.data.dll


You will more likely get an answer here:

<news:microsoft.public.dotnet.framework.adonet>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet/>
Nov 20 '05 #3

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

Similar topics

3
by: Mats | last post by:
It's good practice to validate input, not only where it should be coming from, but from anywhere it's possible to change or add input for a "client". If all user input is transfered using "post"...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
8
by: Sid | last post by:
I hope someone could help me with this. I am trying to setup a criteria to decide when to allow/not allow user to click on the check box. logically it looks simple but I am not able to...
1
by: PALLAVI SHARMA | last post by:
Sir, i have configure the ms access file on webserver. MS. Access file is showing in .../db/mohan.mdb on web server. could you tell me what path should in write in my language to update the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...
0
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...

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.