Finding Primary Key in MySQL Database
Hey all,
Apologies for this question, as I imagine it will be very easy.
I'm creating a form that will be used to update fields in a table. I don't want the user to be able to update primary keys though, so I'm trying to disable the textbox so it can't be edited.
The textboxes are created during runtime, so I'm trying to create an If loop that will see if it is on the primary key column, but i'm unsure of how to do this. I tried doing this:
If dt.Columns(i).Unique = True Then
t(i).Enabled = False
End If
But this didn't work. I found an option called PrimaryKey which would go dt.PrimaryKey... something (I'm guessing) but just unsure of how to use it.
Thanks in advance :)
Wolxhound90
Junior Poster in Training
55 posts since Mar 2011
Reputation Points: 10
Solved Threads: 1
Sorry for delayed reply.
Yeah, I may have to do this. Can't seem to find any other way around it lol. Thanks for your answer :)
Wolxhound90
Junior Poster in Training
55 posts since Mar 2011
Reputation Points: 10
Solved Threads: 1