Thursday, January 31, 2008

Access ain't so bad

I have been working on an app for work. It's written in C#, and it's a data app. One database, and several instances of the app connecting at possibly the same time. I haven't really developed anything with data integration before, so I went hunting for info.

I was really surprised at how hard it was to find what I needed. Starting simple, all I wanted to do was to type some text in a text box, then save it to the database. It IS really simple to do, but the hard part was finding how. I eventualy got it.

I started by using SQL Express, without really thinking about it much, but I realized that it was overkill. I switched to Access, since all company computers have that (just in case, I still don't know if the client app needs to run on a computer that does have Access. My guess is no, but better safe than sorry. Call me lazy, I am). Due to ADO.NET, the type of database doesn't really matter, so most of my calls remained the same between using SQL and Access. Cool. I hear LINQ goes even further than ADO.NET, but I'll leave that learning curve for the future.

I also had to share data between a parent and a child form. That was actually a lot harder than it had to be. MS should really have some pipeline between parent to child and child to child. Once you set up an event handler it works great, but it truly is a pain compared to what I think it should be (declare the variable in either form and using syntax, explain to the compiler "this variable belongs to this form, but that, that, and that form can access it". Would be great).

I have the interface almost ready, and the form for adding a new record to the database is working great. Next will be figuring out how to have several instances working at once without corrupting the database. I could have looked it all up before I started but I have been finding out that is not the most efficient way to work, at least for me. I rather get going, get something working somewhat, then fine tune it and add what's left. Seeing something up and running, even in a preliminary stage, is key to keeping me motivated.

Why am I talking about this? Well, C# skills will definitely help me out in TowerSim. That and it's for work. Work pays bills, which allow me to sit in my idle time and code TowerSim. Logic is a beautiful thing.

3 comments:

kylo said...

Hey,

Just found your blog - I have to say I'm pleased that someone is doing what I'm dreaming of doing for a while now. Sadly, having no programming skills makes it impossible, though I did start on a design document for an ATC Tower sim a while back.

I hope the sim will simulate the Ground position, as that's what I'm after. There was a never completed project called Local1 a while back, but that's in the can apparently!

Miguez said...

Hi kylo,

Glad you're excited. A Ground position is definitely part of this simulation.

Any chance I could take a look at your documentation?

kylo said...

It's a very rough draft without the nitty-gritty, but I'll gladly send it over if it helps. Mail me at kylofon@gmail.com and I'll mail back to you (can;t find your email!).