ADO appears corrupted?

  • Thread starter Anil Gupte/iCinema.com
  • Start date
A

Anil Gupte/iCinema.com

I am having huge problems with my dataset. The change I made was that I was
reading all the information from a plain text file (include column names and
data etc.). Now, I have encrypted the file, then I decrypt it (it decrypts
just fine). I then put the strings obtained in an array and parse each line
(earlier, I was using readline and then parsing each line). Anyway, to cut
a long story short, it appears to create the DataSet, but nothing works - it
won't even recognize the column names. Even in my watch window, if I put in
an expression, I get an error as shown below:

ds.Tables("Profiles").Select("ProfileID='0'") Run-time exception thrown :
System.Data.EvaluateException - Cannot find column [ProfileID].

So you would think I don't have a column by that name. Well in the same
Watch Window, I get the following:

ds.Tables("Profiles").Columns(0).ColumnName "ProfileID" String

Which means that column exists! What is going on? And how can I fix it?

Please help! My software is stuck on this and I am trying to meet a
deadline!

Thanx in advance,
 
S

Siv

Anil,
Just a guess, but do you need the double quotes around the
"Select("ProfileID='0'") " ie will it work with

ds.Tables("Profiles").Select(ProfileID='0')

Siv
 
A

Anil Gupte/iCinema.com

No that will not work (Itriedd it just in case). In fact the correct way to
do it would be

dim strSelect as string = "ProfileID='" & defaultprofile & "'"

dim dr as datarow() = ds.Tables("Profiles").Select(strSelect)
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
Siv said:
Anil,
Just a guess, but do you need the double quotes around the
"Select("ProfileID='0'") " ie will it work with

ds.Tables("Profiles").Select(ProfileID='0')

Siv
Anil Gupte/iCinema.com said:
I am having huge problems with my dataset. The change I made was that I
was reading all the information from a plain text file (include column
names and data etc.). Now, I have encrypted the file, then I decrypt it
(it decrypts just fine). I then put the strings obtained in an array and
parse each line (earlier, I was using readline and then parsing each
line). Anyway, to cut a long story short, it appears to create the
DataSet, but nothing works - it won't even recognize the column names.
Even in my watch window, if I put in an expression, I get an error as
shown below:

ds.Tables("Profiles").Select("ProfileID='0'") Run-time exception thrown :
System.Data.EvaluateException - Cannot find column [ProfileID].

So you would think I don't have a column by that name. Well in the same
Watch Window, I get the following:

ds.Tables("Profiles").Columns(0).ColumnName "ProfileID" String

Which means that column exists! What is going on? And how can I fix it?

Please help! My software is stuck on this and I am trying to meet a
deadline!

Thanx in advance,
 
A

Anil Gupte/iCinema.com

I meant to send this to the group:
I thought that I had checked that, but surprisingly I get

ds.Tables("Profiles").Columns(0).ColumnName = "ProfileID"

and

ds.Tables("Profiles").Columns(0).ColumnName.Length = 10

!!! It should be 9!

However, I cut and paste the first line into Notepad and Word, but cannot
see any extraneous characters. Any idea how to solve this puzzle? How does
one see a "null character"?

Thanx,
Anil Gupte

But anyway, that was the right track. I usedd Trim and it worked! I am
still wondering where these characters got introduced and what they are
(they are not spaces or tabs or even the vbNull character).

Thanx,
 
A

Armin Zingler

Anil Gupte/iCinema.com said:
I meant to send this to the group:
I thought that I had checked that, but surprisingly I get

ds.Tables("Profiles").Columns(0).ColumnName = "ProfileID"

and

ds.Tables("Profiles").Columns(0).ColumnName.Length = 10

!!! It should be 9!

However, I cut and paste the first line into Notepad and Word, but
cannot see any extraneous characters. Any idea how to solve this
puzzle? How does one see a "null character"?

for each c in ds.Tables("Profiles").Columns(0).ColumnName
debug.print(ascw(c).tostring("X2"))
next

Output?


Armin
 

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

Similar Threads

DataGrid Style 3
selectedrow in datatable 1
Dataview sort not working 3
vb.net error 2
Translate C# to VB.net? 7
vb.net early binding coding format 4
IF statement is 'not working' 5
DataSet Select error 1

Top