This is not a homework problem & my first post in 2+ years. I just got asked to do this in C# based on my asp & DB experience & I am tearing my hair out as they want in done in one day & 2 MS videos say to do the same thing & it does not work (at least does not display like their examples did.

I managed to get the Access Database connected (it checked out ok) and I actually can see the data in the tables in the C# IDE (solution explorer), but when I followed the Microsoft video steps telling me to create a dataset & then drag the table to a form, all I see is the empty table. The columns titles showed up fine, but when I went to build, no data shows up like in Beth's video, even though I can see the table data if I look at the table in the solution explorer (100's of lines).

I can't find any info on how to troubleshoot this, as it seems so basice, no one else has had this issue? I hope some one out there can help me figure out why I can't see the data in the Form Table. is there something in Properties that was not mentioned that I have to set to allow it to flow in?

TIA to all to try to help!

Recommended Answers

All 18 Replies

Make a copy of your access database, truncate the tables, add a test row in each table, and upload the database.

Tried to & get the same results. I can see the rows in preview, just not on the table. When I try to add data in CS, when i try to save, I get:
InvalidOperationException was Unhandled
Microsoft Jet.OLEDB.4.0 provider is not registered on local machine.
When I open the access db directly in Access I get a warning about unsafe queries or the like & suggesting that I install some this Jet thing, which I passed on since I know the database source is ok.

I read something about needing controls on the form, but Beth just dragged the table node 7 then hit build. No other controls, unless I missed something.

I asked you to do that so I would have a copy of your database tables that I could test on........ I don't see the database attached.

I asked you to do that so I would have a copy of your database tables that I could test on........ I don't see the database attached.

duh, sorry, I was so stressed out & have been away from programming I thought you meant for me to try attaching the shorter DB. I have truncated from thousands to 220 on one table, the other 2 are smaller. There is a test row at the bottom of 2 tables, the state table auto aphabetized the testrow under T.

From reading it seems that I was supposed to at controls to the form first, but the tutorial I was following did no such thing. I tried following the northwind tutorial even though its (the database-it came with either the C# program or the tutorial I downloaded) on my pc, & "ok" when I connect the database, when I tried to do a different exericse, I got an "access not allowed"error.

Didn't comprehend that you wanted the DB. Now I understand , but I had to zip it to upload. It is only 3 tables. Thanks.

I'll make a project for you with a grid and a screencast of how I did it. Will that work?

For someone w/a degree, it seems I do not comprehend english today.
First of all, thanks so much & I am really glad you are online at this hour as I am getting desparate trying to use tutorials that don;t work.
Does the grid mean steps of what to do?
I assume screencast means a video?
If yes to either, that sounds wonderful.

Here is the project, I can't get the video to upload .. the forum keeps bombing out saying upload failed. Let me try it another post.

Ok the video won't attach, I will PM you a download link and please post back here or PM me when you're done so I can delete it.

I just got the video to work. flash does not work in vista, unlesss you know how to go in & turn it on inside 6 layers of files. After 2-3 tries to reinstall, I googled & found out the proble, then had to find the solution, which actually worked.

I only watched the first few seconds to see that it worked, so I could report back that I got that far. Its a bit fuzzy, so its going to take me a bit to figure out what I am looking at & compare to to my project. (Honestly I am not complaining!!) Just give me some time to figure out what I am looking at & see if it makes sense.

I am not sure where these steps pick up/start: right after selecting a dataset? i think thats where I messed up cuz there was no drop down arrow to continue.

Starting to feel hopeful, thanks to you!

It should be almost crystal clear unless you have a small monitor and it downsampled the video quality. I'm on a 24" monitor and the screencast was ~80% of the width of my screen.

I started with a new empty project, added a dataset, table adapter/table, grid, then ran it.

Sorry for the delay. I did not see that this message was not posted until I went back to this window. Does Daniweb autologout user after a set time? Or am I just blocked from PM as new/few poster?

Anyway: I am on a 15.4 toshiba laptop with all the monitor settings on the defaults.
Resolution is max (1280x800). I enlarged the video to full screen & it is definitely clear enough to see at that size & yes, I see where it starts. I should be (update, so far can- have been working on it since I got it going!) able to follow this. I really can't believe that MS just skipped all of this. No wonder it would not work.

So I assume that I just repeat this procedure for each table to show on its own form, right?

Then I need to pull each alias from the alias table & figure out how to test it comes out as a match to the one matching school on the school page.

Where do I put this code? Do I make a new form that pulls an alias from its table, does the test/match algorithm & then outputs the correct school name to a different (new? table). I assume to do that I need to create & attach an empty table ready to recieve the output, right?

Then somehow I am supposed to test how many alias's were correctly matched. (The full table lists several thousand schools, each with up to 40 alias/alternate spellings etc).
Where do I put this code? in the program.cs code or a form that displays the results?

Having never used C# before, am I in over my head, or am I just stressed out cuz I am trying to learn a new environment overnight? (probably not recommended, as I used to take about 3 weeks to learn a new language).

Thanks so much for all you help!

Eh I don't even know where to start answering you, that was a lot of questions. For tables that have relationships to one another you can add them in the same dataset. Right click and add another table adapter inside your existing DataSet and you can add additional tables.

If they're unrelated you can create another dataset. Its mostly an organizational preference although the DataSet can enforce relationship constraints if you tell it to.

Lets go back. I have followed your video 20 times & every time I get stuck at the half way point: DataGridview Tasks/choose data source/project data sources/then down 2 levels to the table itself.
But it never transfers the table to the form. I am ready to scream.

Please help. What am I doing wrong?

What do you mean by it never transfers the table? The dataset, bindingsource, and table adapter aren't created on your form?

Datasource yes/binding source yes
table adapter no.
I think I just one table set, but I still can't figure out how to display the data.

Do I need 3 forms, one for each table?

& then call data the tables in the codefile.cs to compare & sort various alias to one real name?

You need the table adapter to display the data. The DataSet is what holds the data, the bindingsource lets the grid scroll around the records one-by-one (basically, it is a little more complicated) .. and the table adapter is the work horse. The TableAdapter is the link that fetches the data and populates the DataSet, thus lets the bindingsource move around. Without the table adapter your dataset is empty, thus no data.

Data Model:
Data Presentation <---> Table Adapter <----> DataBase

In theory you could have the same DataSet, and a CSVTableAdapter, ExcelTableAdapter, SQLTableAdapter, etc. and let the user store/retrieve the data in any format you have an adapter for.

Thanks so much for all your help. I will be offline for the next 30 hours, & then back at it. I have not solved my problem yet, but not for lack of your help. I think I understand the issue, I just am having issues getting the parts connected.

One table did bind, so I assume that means that I could play with that data, assuming I can figure out how to access & display it.

My .cs file is practically empty, unlike yours that has tons of stuff. I tried using an empty project, and adding the parts, so each screen matched your, but then I got a "missing main()" error. I put that in & it builded, but thats as far as I got. When I tried using console project I did not even get that far--no idea why not.

I even tried coping files from the test project you sent back, but that won't work either, since the datasource is wrong. But I was wondering, if I just change the database connection to the full sized database, it should work, right? Or will all the bindings cancel out if I do that?

Perhaps after some sleep your video will sink in better & I'll notice whatever detail I am missing. Thanks again & if I am lucky you'll be back online when I am. Take care.

It sounds like your visual studio install is screwed up. Did you create a new windows form application? It should declare a static Main() in Program.cs. What version are you running?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.