mike55 Posted July 28, 2004 Posted July 28, 2004 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 Quote 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)
Joe Mamma Posted July 28, 2004 Posted July 28, 2004 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 Quote 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.
samsmithnz Posted July 28, 2004 Posted July 28, 2004 Can we see some code? Quote Thanks Sam http://www.samsmith.co.nz
huby Posted July 28, 2004 Posted July 28, 2004 you using c# or vb.net ? in c#, remeber to use ToString() : while (myReader.Read()) { myName = myReader["name"].ToString(); } Quote there are 10 kinds of people on earth: those who understand binary, and those who don't.
mike55 Posted July 28, 2004 Author Posted July 28, 2004 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 Quote 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)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.