Question Hardcoded Dataset, tableBindingSource and everything in between

thugster69

Active member
Joined
Jun 17, 2010
Messages
35
Programming Experience
Beginner
Hey guys,

Im new to VB.net programming and I was wondering on how can I hardcode all of this components.

What I'm trying to accomplish is that I want to create my own Binding Navigation along with other components hardcoded so that I can navigate through the DatagridView with my own buttons.. Here is a screenshot


ScreenShot020.jpg


P.S.

do you guys even recommend hard coding or you just do it visually?
 
Use all of the stuff the IDE creates and just delete the BindingNavigator if you want to create that yourself. Wire up buttons to call BindingNavigator.Move(Previous|First|Next|Last) etc.
 
Wire up buttons to call BindingNavigator.Move(Previous|First|Next|Last) etc.
Typo: -BindingSource.MoveNext etc
 
@JohnH and MattP

Use all of the stuff the IDE creates and just delete the BindingNavigator if you want to create that yourself.
?
What IDE stuffs are good for visual designing and what are better off hard coding? In my experience, i've been connecting to my database, executing commands, filling datasets programatically.. Is that even a good practice?
 
In my experience, i've been connecting to my database, executing commands, filling datasets programatically.. Is that even a good practice?
It is usually much easier and faster, less error-prone, and better practice, to have IDE generate that stuff for you, based on the wizards and visual design choices you do towards the database.
 
@john

But why is it that plenty of programs I see in the internet are programatically coded? Is there any step by step guide out there that can enlighten me on my problem?
 
But why is it that plenty of programs I see in the internet are programatically coded?
You mean 'why is there so much old crap on the web'? ;)
I guess it's easier to post 10 lines of code to show some task than to explain 'you have to click here, here and there, then do this and that'. Visual tasks may be easier to show with some explanations and screenshots, or perhaps video tutorials.
 
@John,

You mean that's really the old way? What about the topic that is 'stickied' in the topic about this thread? Why is it still present and on demand?
 
I beg to differ on the statement it's "better practice, to have IDE generate that stuff for you".

When creating static interfaces that don't change it can be very helpful and productive to use the visual designer IDE. But it isn't very helpful in creating dynamic interfaces at all! Instead you end up fighting with the IDE and the way the default code wants to act if you want to create your own features (like docking, dragging, resizing, custom control interactions, etc).

If the default way of doing things is how you want things done. Then oh yeah the IDE designer is all you'll ever need... it's productive... and is the point of the visual designer... because it increases your productivity and speed.

But that doesn't mean it's better practice.
 
I beg to differ on the statement it's "better practice, to have IDE generate that stuff for you".
I said usually, meaning it usually help people, esp newcomers, avoid putting silly data access code in their UI class, and avoid wasting time writing lots of code when you don't need to. A developers first experience with data access in VB.Net should be anything other than writing "Dim" code in a UI event handler. That you have 'outgrown' Visual Studio functionality for data access means you should know better than to object to the use of wizards and typed datasets as a better practice for people that is just starting to learn.
 
hrm?

you should no better then to tell novices that it's "better practice" and allow them to believe that it's outdated to write code instead. That'd be like me saying to a arithmetic student "Oh don't bother learning your times tables, that's what a calculator is for!" When it's not, and when you get further into math you tend not to use calculators and the ability to do arithmetic quickly in one's head is very important.

I'm sorry but I'm tired of sloshing through spaghetti code and nonsense by programmers who've been in the gig for quite some time, but never learned to advance themselves because everyone else said "let the wizard take care of it".


@OP - learn this now, and learn it quick... no question of your should remain unanswered. Research it, get opinions, look under every crack, and listen to everybodies responses. 9 times out of 10 the easy answer isn't actually the right answer. It's just an answer that happens to get it done right now... but leaves you not knowing what the hell you did.

Yeah someone can explain to you that the derivative of x^3 == 3x^2... but if no one ever tells you how to actually solve a derivative, you're kind of screwed the next time it comes around and the question is what's the derivative of sin(x)




whatever happened to asking "but why"? Oh wait, I remember, my teacher always told me to stop asking why and proclaimed "because I said so". Until one day I pointed out all these 'facts' he was giving me on faith were actually wrong!
 
Last edited:
I said usually, meaning it usually help people, esp newcomers, avoid putting silly data access code in their UI class, and avoid wasting time writing lots of code when you don't need to. A developers first experience with data access in VB.Net should be anything other than writing "Dim" code in a UI event handler. That you have 'outgrown' Visual Studio functionality for data access means you should know better than to object to the use of wizards and typed datasets as a better practice for people that is just starting to learn.

To add into details, I've been through using wizards like Data Source Wizards, draging datasources in the Windows Form to create either Textboxes with Additional BindingNavigator and others..

hrm?

you should no better then to tell novices that it's "better practice" and allow them to believe that it's outdated to write code instead. That'd be like me saying to a arithmetic student "Oh don't bother learning your times tables, that's what a calculator is for!" When it's not, and when you get further into math you tend not to use calculators and the ability to do arithmetic quickly in one's head is very important.

I'm sorry but I'm tired of sloshing through spaghetti code and nonsense by programmers who've been in the gig for quite some time, but never learned to advance themselves because everyone else said "let the wizard take care of it".

It's okay to tell novices- in this case me, to practice first on doing things out a wizard.. It's truly fine with me.. But when i heard of hard coding is outdated, I was really worried since that was the thing that I have striving to learn for the past 3 months..

I even asked my college professor if he has a step- by - step guide in doing things programatically.. And he said that he'll bring me one on Monday..


So, now my question is, do you know any sites or threads(esp here in vbdotnet) that can guide me through this dilemma of mine?

Thanks for all of the reply!!

You're my heroes..
 
Sorry to repost.. But can I get any help on finding a thread or site where I can learn hardcoding step-by-step? Thanks!
 
Back
Top