Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Yo

 

Have a database table of customers containing a mixture of integers (used in the reference numbers etc.) and chars (names and addresses). Am doing a select * on the table and loading the data into a dataReader, the problem occures when i attempt to take the contents of the data reader and put it into a string array, i get a message telling me that the specific cast that i am using is not valid, has anyone any suggestions or alternative??

 

Mike

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Posted
  Quote
Yo

 

Have a database table of customers containing a mixture of integers (used in the reference numbers etc.) and chars (names and addresses). Am doing a select * on the table and loading the data into a dataReader, the problem occures when i attempt to take the contents of the data reader and put it into a string array, i get a message telling me that the specific cast that i am using is not valid, has anyone any suggestions or alternative??

 

Mike

hy no use a dataadapter to fill a dataset. the table in the dataset is already an array

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted

you using c# or vb.net ?

 

in c#, remeber to use ToString() :

 

while (myReader.Read())
{
   myName = myReader["name"].ToString();
}

there are 10 kinds of people on earth:

those who understand binary, and those who don't.

Posted

Managed to solve the problem, found that there are a number of sql variables also available.

 

while dataReader.read

stringArray(0) = dataReader.getSQLInt32(0).toString 'reference number

stringArray(1) = dataReader.getString(1) 'names

stringArray(2) = dataReader.getSQLMoney(2).toString 'Money values

End While

 

 

Mike

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...