473,396 Members | 2,036 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,396 software developers and data experts.

datareader reader questions

I am trying to use a datareader to retrieve data and set some properties. I
am getting a "Specified method is not supported" error on Line xxx. The data
base is Oracle 9i and the field is a number is Oracle, which will be an
integer.

Code below

The query will retrieve only one record or the datareader will be (empty?).
How do I test for an empty datareader and return a "You're not in the db"
exception?

Thanks for your replies

Mike

Code:

private void getUserRightsFromDB(string userLogin)
{
string SQL;
SQL = "Select ID, USER_ID, USER_NAME, USER_EMAIL, USER_RIGHTS From ";
SQL += "drewermr.TAB_USER_RIGHTS Where USER_LOGIN = '" + userLogin + "'";
//Set command type and string for command object
this.OraCommAssistLogin.CommandType = CommandType.Text;
this.OraCommAssistLogin.CommandText = SQL;
//open db
this.openDB();
dr = this.OraCommAssistLogin.ExecuteReader();
dr.Read();
//retrieve values from database
this.user.DBID = dr.GetInt16(0); // -- Linexxx
this.user.UserID = dr.GetInt16(1);
this.user.FullName = dr.GetString(2);
this.user.EmailAddress = dr.GetString(3);
this.user.UserRights = dr.GetString(4);
this.closeDB();
}
Nov 17 '05 #1
0 1009

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

Similar topics

2
by: rob | last post by:
I'm having some trouble with this.. My VB datareader seems to skip the first record in the reader. I've looked at my query in enterprise manager to confirm what I am suppose to receive back,...
6
by: Yasutaka Ito | last post by:
Hi, My friend had a little confusion about the working of DataReader after reading an article from MSDN. Following is a message from him... <!-- Message starts --> I was going thru DataReader...
5
by: Joel Reinford | last post by:
I am attempting to verify whether a datareader is closed by calling the databind on a control. for example (fake code) Dim rdr as SqlDataReader rdr = mycommand.executeReader... ...
20
by: Mark | last post by:
Hi all, quick question , a DataView is memory resident "view" of data in a data table therefore once populated you can close the connection to the database. Garbage collection can then be used to...
17
by: Alan Silver | last post by:
Hello, I have a generic method in a utility class that grabs an sqldatareader and returns it. Due to the fact that (AFAIK), you can't close the database connection before you've read the data,...
4
by: dejavue82 | last post by:
I am trying to use a DataReader to read a table (that was attained from JOINing two other tables) with the following format: questions answers 1 1 1 ...
10
by: jimmy | last post by:
Hi again, sorry for posting two questions so close together but im working on a school project which is due in soon and running into some difficulties implementing the database parts. I have the...
3
by: Johnny Jörgensen | last post by:
I've got an error that I simply cannot locate: I've got a form in which I use a datareader object to read information from a db. After the read, I close the reader and I dispose of both the...
3
by: Osamede.Zhang | last post by:
I have some code like this: SqlCommand cmd = new SqlCommand("get_storeid_byuser", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@username", SqlDbType.VarChar, 50).Value...
1
by: =?UTF-8?B?QXJuZSBWYWpow7hq?= | last post by:
JB wrote: if(!reader.IsDBNull(swimcol)) { // use (string)reader } else { // use some default value maybe null
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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.