rs.fields

Bryan

Well-known member
Joined
Jun 17, 2002
Messages
49
Location
Cedar Hill, TX
ok, it seems microsoft changed way to much when they went to .NET

in VB6 if I wanted to set a string equal to a value of a field in a record I did:

stringname = rs.fields("FieldName")

now when i do that .NET gives that cute little blue squigly line underneath the rs.fields("Fieldname") and when I hover my mouse over it I get the message that says "Value of type ADODB.Field Cannot be converted to String."

So do any of you here know how I set the value in a field into a string? I cant figure it out.
 
I havent worked w/VB.Net yet, so Im not sure if thisll work, but it may be worth a shot...

Try this
Code:
stringname = rs.fields("FieldName").ToString
 
This forum has a VB .net section..maybe try your question there too. I also have never use .Net yet so I cant provide any insight. I have browsed that particular section and there seems to be a lot of help and expertise there. I dont know if you have posted this same question there, but it is worth a shot.
 
i didnt know there was a .NET section. Thats cool. But I did get my question answered. For those of you wondering it goes like this:

stringname = rs.Fields("Customer").Value
 
Its the same in vb6. The difference is, in vb6 (and previous) you had default values. In .Net, you no longer do.
 
Back
Top