important: I'm using MS Acces, not because I want to. But because it's the only thing I've learned and I don't know how to work with other types of Databases and don't exactly have the time to learn to do it.
Okay so a bit of background info, I'm a student IT and I'm doing my internship, but because of Covid, I'm basically on my own; I'm writing a website on which images with titles and catagories have to be displayed, these images have to come from a database. Because the person for whom I'm writing the website knows nothing about coding I had to make a c# user interface application, for him to fill in the database. Now I'm only putting strings in this database, so instead of straight up images, it's more like image.jpg. But I need to put the data from the database into a list <string>
, keep in mind I'm writing the website with C# ASP.NET. So I need this list in which I want all the string that are in one column of my table. To do this I figured I could make a for loop that would stop once there are no more records in the table. Now this loop worked sure, and everytime the loop restarts something would go into the list. Here is the code of that.
string amountRecordsStrg = "SELECT Count(Id) FROM TbGallerij;";
int amountRecord = Convert.ToInt32(amountRecordsStrg);
for(int i = 0; amountRecord > i; i++)
{
artTitel[i] = "SELECT tbGallerij.AfbeeldingTitel FROM tbGallerij;";
}
}
Now, the probLem I'm having is that I don't know how to select the specific record. by example: artTitel[2] = the fieldvalue in the column Afbeeldingtitel in the second record in the table tbGallerij
I looked up a bunch of things online, and found out about the existence of OFFSET and FETCH which should save me, exect for the fact that I don't know how to use it at all in access, it doesn't seem to work. Can anyone help me please? It's really important that I find a solution to this. I tried using the top
keyword like suggested here MS Access LIMIT X, Y. But it didn't work and I also found the answer quite confusing and even after trying to analyze it, it didn't do what it had to do for me.
PS: I'm sorry if something in the text doesn't seem clear, if so please comment and I will edit it. I'm also sorry if the question isn't very clear. As you can see from my reputation, I'm not the greatest at asking questions/explaining things.
Summary: I need a way to select one specific record, such as the second record. Or the fifth record, and I can't just do this with the ID's because they change the whole time when records are deleted. Anything that could solve this would be greatly appreciated.