|
-
Oct 5th, 2008, 11:53 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] ADO in Visual 2005
Hi guys,
Been reading some stuff here on ADO.NET i have an limited understanding of ADO in VB6 and i am trying to work out the presence of Index integars rather than table and row & column names i find this confusing how do i see what index relates to what table,row or column? and can i not just refer to them by name?
Thanks in advance.
-
Oct 5th, 2008, 11:56 AM
#2
Re: ADO in Visual 2005
Wow - that was totally confusing...
INDEX's are simply objects in the database.
Are you saying you want to find out the names of the index objects in your database?
And that you want to find out what tables and columns they relate to?
What is your backend database?
-
Oct 5th, 2008, 12:07 PM
#3
Thread Starter
Fanatic Member
Re: ADO in Visual 2005
He He here is what i am refering to
Code:
If ds.Tables(0).Rows.Count > 0 Then 'Check if the table is empty
txtFirstName.Text = ds.Tables(0).Rows(0).Item("FirstName").ToString()
txtLastName.Text = ds.Tables(0).Rows(0).Item("LastName").ToString()
txtLocation.Text = ds.Tables(0).Rows(0).Item("Location").ToString()
End If
Anyway i have never seen this in vb6 with ado. Although i never had a next record facility in my db App before i allways searched for records.
Thanks. is an Access 2000 db btw
-
Oct 5th, 2008, 01:35 PM
#4
Re: ADO in Visual 2005
In short, yes.... the variable ds is a DataSet. A DataSet can contain one (or none if it's empty) or more DataTables. When the datatable is created, you have the option to give it a name. If you don't it gets a default name (not sure what it is, but probably along the lines of TableX where X is a number in sequence.) So, for teh tables part, yes you can refer to it by number or by name. Each DataTable is then made up of DataRows... now, rows are jsut that, rows ... so there isn't a way to refer to them by name, only by index. Where 0 is the first row, 1 is the second, etc. Item is the column... again, like tables, you can refer to them by name or by index.
You might want to peruse the database FAQ here, it's got several tutorials and links to help you get started.
-tg
-
Oct 5th, 2008, 03:15 PM
#5
Thread Starter
Fanatic Member
Re: ADO in Visual 2005
Thanks i did look at all the stuff here hence this question because it isn't refered to in any of the ones i looked at and it is a big difference to vb6 -ado.
i can now see the index as i posted previous its not some thing ill use as ill be searching my db rather than keying forward or back and linking my tables by the same field containign the key word(telephone number) thanks again i am sure ill be back so thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|