Click here to Skip to main content
15,905,316 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, Mr.Christian Graus

Thanks for your notes about the DB design, I will modify it as you suggested, but still the problem is how to bind the data after updating, and how to handle the Edit/Update Events knowing that the required Variables for the update command will be taken from the previews page (log in). it will be great if any one can give a code example.

I appreciate any inputs regarding this problem.

thanks again


Hi again
Mr.Graus, please don't mistake a person to be below the level of your intellect, with a person who is really busy to go through a complete article.

Don't think that I'm ungrateful for what you have written in your answers, because I am.

And the matter of dynamically adding a column will be resolved as for the solution is a really easy and simple thing to do.

And by posting my e-mail i wasn't what so ever depending on you providing me with a full solution to something that i have to do, I was merely looking for some input that would help in the matters discussed in This post nothing else.

And the posted e-mail is a temp. e-mail used for our project and will be deactivated as soon as we finish our project and for that I really don't care about spam, as it's not my personal e-mail.

And as for my naiveness in database's in general, it's because that it's not my specialty, where my specialty is Computer Networks & Embedded Systems.

And again, please don't mistake all that as being ungrateful.

Updated 21-Mar-10 1:12am

However, you did not provide your handler function which is used to update the data in grid... as you discussed in your question.

My suggestion is, if you need to update or add data through a form or external interface (then grid), your approach to connect data through connected mode using SqlCommand is correct and in case you need to add or update the data in grid itself... then better to use databound grid and use SqlDataAdapter and Dataset.

Use of SqlDataAdapter supports the use of SqlCommandBuilder Class which can be used to add or update the data in table. It ease the inline addition and updation of data in grid itself.

So if you could uniquely specify your need from above two requirements, I will find ease to supply relevant code example to you.
Share this answer
Hello khalel - why is it both you and your partner can't follow simple instructions ? If you couldn't work out from what I did and what I explained to NOT push the 'answer' button to ask more questions, why would I assume you had any capability of following the more complex instructions you're asking me for ?

Khalid57305 wrote:
what did you mean by using a procedure??

A stored procedure. Surely you're using stored procedures in your database ? If not, what is your job on the project, to create some tables ?

Khalid57305 wrote:
what is the problem with adding a new column in the attendance table upon lecturer sign-in (Fingerprint, in class) with that lecture's date as the column's caption.

It's insane. It's the worst database design I've ever heard of. The lecturer signing in should create a row in the table. The schema of the table should not change. I'm sorry if we just have some confusion over terminology, but if you're adding a row, then your whole question is insane, because in that case, there is no extra column and no reason to change your SQL, your presentation layer, or anything else.

If you're doing what you say you're doing, then you have not even the most basic idea of what a database is for, or what makes it useful.

Khalid57305 wrote:
please bear with us, as we are out of our field.......

Well, I am trying to help, but how can you be so totally lost when this is meant to be for a class. Did the lecturer not teach you anything ?

Sadly, deleting messages seems to have broken again, so I can't delete your fake 'answer', although I did copy it into the main body, for my own convenience, and to show you AGAIN how it should be done. I will try to at least remove your email address. I don't get how there's people whose entire development plan seems to revolve around the kindness of random strangers, to the point that you think I'd email you. I'll tell you who will, and that's every spammer who trawls the web looking for people dumb enough to make their address public.
Share this answer
I don't see why you'd be adding columns to your table daily. That seems like a broken design to me. Every day, someone updates the database schema ? If someone is updating the database to add a column, why not have them update a stored proc or two to pass in or return those columns ? You could try to write your code so it dynamically works out the column names and knows those are the variable names to pass in, but you'd still need to change your edit template to allow you to edit the new column.

I think I'm missing something very fundamental about what you're trying to say, because it sounds illogical and complex to me right now.
Share this answer
Delete buton seems to be gone. Do not post lengthy additions to your question as an 'answer', edit your post so people who answer can see all you've written when they do.
Share this answer
Delete is broken again. DON'T push 'answer' if you're not answering ( edit your post ) and DON'T make your email address public. If you won't even read our site, why would we email you ? And any answers get emailed to you if you gave your address to the site when you registered.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900