Reading data from Access and save it into an array


J

J. Clarke

Ye stupid to speak of line in code. I meant this line:"//-----------"
I dont understand what the two lines under this line are doing.

Those two lines are setting things up for the subsequent loop--they're
associating the SQL query stored in the string strSQL with the database
connection con established two lines previously, and then creating a
reader object to repeatedly perform that query.

Note that this is realy a .NET question not related to C at all--the
..NET calls would be the same (allowing for differences in language
syntax) in VB.NET or Powershell.
 
Ad

Advertisements

J

James Kuyper

Ye stupid to speak of line in code. I meant this line:"//-----------"

Just because you knew what you meant, doesn't mean that people who can't
figure it out are stupid. You expressed yourself poorly.
I dont understand what the two lines under this line are doing.

You're using C# to access a package(?) named System.Data.OleDb. You'll
get the best answers in a forum where that package is on-topic, and this
is NOT such a forum. I know nothing about either C# or that package, so
the best I can do is guess - but the code seems pretty clear. You're
sufficiently confused that you're posting questions to the wrong forum,
and insulting those who you're asking for help, so even my "stupid"
guesses might be an improvement over your confusion:
OleDbCommand cmd = new OleDbCommand(strSQL, con);f

This statement creates a new object of type OleDbCommand, initialized
from strSQL and con, and stores it in cmd. What initialization actually
does is up to the designer of that package, but it presumably sets 'cmd'
up to represent the execution of the SQL query specified in strSQL,
being executed against the database identified by 'con'.
OleDbDataReader dr = cmd.ExecuteReader();

The name implies that this line causes the result of the SQL query to be
read from the database.
 
J

James Kuyper

On 05/26/2014 06:12 PM, James Kuyper wrote:
....
... Putting an a
appropriate comment on or near that line is one simple way to do that.

Let me clarify: by "appropriate comment" I mean something like

// I don't understand the following two lines:

The actual line you were referring to:

//--------------------

is a comment, but not an "appropriate" one for this purpose, because it
contains nothing to clearly identify it as the line that you were
referring to. I've seen a lot of code containing similar comments solely
for purposes of decoration.
 
K

Kaz Kylheku

(This is all from memory, and it was all a long time ago, so I apologise
in advance for any inaccuracies. Any biases are purely intentional.)

I have no pointers to the court case in question - and I'm sure you can
google as well as I can. But just in case I was being too cryptic, the
point was that for a while MS shipped a version of Java with IE that was
incompatible with Sun's Java.

And then MS ended up in court? I'm confused: which of the two parties
is it that had the tantrum?
 
K

Keith Thompson

Ye stupid to speak of line in code. I meant this line:"//-----------"
I dont understand what the two lines under this line are doing.

That's so badly phrased it's hard to tell what you're saying.
If you're calling the people who are trying to help you stupid,
that's (to put it mildly) not constructive. It was not clear from
your previous question which line of code you were asking about,
which is why you were asked to clarify.

In any case, you've already been told that this newsgroup does not
discuss C#. I suggest you (a) find a forum that discusses C# (or
..net), and (b) be more polite with them than you're being with us.

If you weren't calling us stupid, then some of the above doesn't
apply -- but I still suggest you take some time to write more
clearly than "Ye stupid".
 
M

marvin.radke

I'm sorry if people here thought i call them stupid. Actually i meant that i was stupid for saying line.
Yes i already know this is the wrong forum (recognized it as people started to make fun of me).
anyway thanks for the tries to help me and good bye.
 
Ad

Advertisements

J

James Kuyper

I'm sorry if people here thought i call them stupid. Actually i meant that i was stupid for saying line.

Self-deprecation can be dangerous in a medium where readers can't get
any clues from facial expressions or tone of voice. Unless you're
careful, a few typos can leave people unaware that it was, in fact,
targeted at yourself.

Simplest correction:

"Ye[s, I was] stupid to speak of [a] line in [the] code."
 
K

Kenny McCormack

was stupid for saying line.

I am sorry they are stupid too.

Kiki and his ilk on this newsgroup are nothing but professional victims.

They long for the opportunity to feel insulted - and when they find it,
they milk it for all its worth.

--
(This discussion group is about C, ...)

Wrong. It is only OCCASIONALLY a discussion group
about C; mostly, like most "discussion" groups, it is
off-topic Rorsharch [sic] revelations of the childhood
traumas of the participants...
 
S

Stephen Sprunk

Just to keep the record straight. There was NEVER a question of
"copyright infringement". Microsoft licensed Java from Sun.

.... and that license was contingent on MS's Java being "compatible" with
Sun's Java. It was not, therefore the license was void and they were
guilty of copyright infringement.
Sun accused Microsoft's implementation of Java as violating their
trademark because it was "incompatible"

Microsoft also licensed the Java trademark from Sun under the same
terms, so my above clarification applies to that as well.
- it offered alternatives to bypass the JNI (and RMI), Java class
libraries, Sun's clunky runtime, and produced highly optimized code
for the Windows environment.

Of course Sun didn't approve. <g>

The intent behind Sun's strict licensing of the Java trademark and code
was reasonable; their implementation did indeed leave a lot to be
desired, but it was their stated intent that others could develop their
own--as long as the _interface_ remained compatible with Sun's.

Compare to C, which 25 years after initial standardization still faces
severe portability problems due to many different dialects, granted not
as many as there were prior to standardization. Imagine if ISO could
sue implementors who used the C name but didn't strictly conform.

S
 
Ad

Advertisements

R

Richard Bos

Keith Thompson said:
Web interfaces like Google Groups sometimes have a problem where a user
can click a "Submit" button, and it doesn't clearly indicate that the
article was actually submitted, but the button doesn't go away.

The choice of a bad tool is no excuse.

Richard
 
Ad

Advertisements

J

James Kuyper

The choice of a bad tool is no excuse.

I believe it was provided as an explanation, not an excuse. While Google
Groups is a bad tool, a newbie (even a smart one) can use it to post
messages for a long time without noticing any of it's problems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top