Wrox Programmer Forums
|
BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3
This is the forum to discuss the Wrox book Beginning C# 3.0 : An Introduction to Object Oriented Programming by Jack Purdum; ISBN: 9780470261293
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 1st, 2011, 06:54 PM
Authorized User
 
Join Date: Feb 2011
Posts: 21
Thanks: 2
Thanked 0 Times in 0 Posts
Default Calling stored procedures

Good evening,
Im currently trying to write a short program which will create a table in MS SQL server, read a .csv file and store that data in the table before finally displaying the data back on the form.

I realise that the example in the book is for an access DB so am i correct in assuming i should follow the code in the following links?

http://support.microsoft.com/kb/307283

http://support.microsoft.com/kb/320916

http://blog.sqlauthority.com/2008/02...to-sql-server/

Or are you familar with a better resource?

Thanks in advance

Rgds

Scolty

Last edited by scolty; June 1st, 2011 at 07:17 PM..
 
Old June 1st, 2011, 11:40 PM
Friend of Wrox
 
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default Different database

The sources you found should work fine. The major difference as far as C# is concerned is the connection string, which is given in the first source you mention. (While the Access database was a good learning tool and actually had pretty good performance. I think Microsoft bought it from Fox Software to get the Rushmore technology. However, as computer systems became more networked, it became clear that Access got a little slow when the number of users increased above five or so.) You should be able to work the exercises once the connection string is changed.
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)
 
Old June 2nd, 2011, 02:53 AM
Authorized User
 
Join Date: Feb 2011
Posts: 21
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Good morning, thanks very much for replying. If the connection string is the only main difference i will use your example for the creation of the database before writing the classes used to call the stored procedures in the database object.

One last question, ive been told i should look into the c# standards. I really like the way you code so i was wondering if there was a specific one you use or is most of ur style a collection of personal preferences?

Thanks again for your help
 
Old June 3rd, 2011, 09:08 AM
Friend of Wrox
 
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default Coding style

I've never been dogmatic in my books about coding style. That said, however, I was a tyrant with the programmers who worked for me when I owned my own software company. For example, every method/function had to be introduced using the comment style shown in the book (e.g., p.252). This promotes consistency which makes it easier for others to read your code. Also, we wrote tools that would parse the source code, pull out these headers and record the name, parameters, source file, and page number for each method. This became documentation for the other programmers without requiring someone to read and transcribe the data. Running the tool once a month kept our documentation up to date without a hassle.

I always use braces, even on single-line if, for, while, etc. statements. It makes it easier and faster to add a temporary debug line of code when necessary, or add new statements if needed.

I tend to have longer variable names that most, in an attempt to make reading the code easier.

I only use comments if the code doesn't speak for itself. Code with no comments is rarely a good idea, but code with too many comments is just as bad--perhaps worse--as they can get in the way of understanding what's going on.

For managers: I always had team programming goals (i.e., "deadlines" is a less polite word) that rarely exceeded three weeks. Since my company was small, a "team" was usually only two people, rarely three or more. Friday mornings were always set for code review and everyone had to attend. Having a dozen eyes dissecting your code is a great learning experience and quickly shows bad habits if others can't follow you code. This is really important in a small shop as people do get sick and you need someone to be able to jump in and work on the code while you're gone. If the Friday meeting was a code review involving a three-week deadline and the goal was met and passed, lunch of beer and pizza was on me and they got the afternoon off. You'd be surprised how this fosters a team spirit. I can't tell you how many times programmers not even on a team stayed late into Thursday night to help a team get its code done. Such effort also helped keep other team members "in the loop" on what other team members were doing.

As a general rule, pick a coding style that works for you and then use it consistently in your code. It's the consistency and what works for you that matters, not what someone else thinks is right.
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)
 
Old June 4th, 2011, 09:22 AM
Authorized User
 
Join Date: Feb 2011
Posts: 21
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Sounds like a pretty good way of encouraging team work n getting the assignment completed on time :)

Thanks again for the advice + i hope ur having a nice wknd!
 
Old June 4th, 2011, 08:16 PM
Registered User
 
Join Date: Jun 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to learn store procedure?

I am beginer level of sql i want to learn store procedure so please give me the solution.

with regards
rameshv
 
Old June 6th, 2011, 08:15 AM
Friend of Wrox
 
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default Stored procedures

I'm not sure I understand the question. Do you have a specific question about SQL taken from my book, or are you reading something else? What question are you trying to find a solution for?
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling Stored Procedures from VBA Made Easy? dabrowne Access VBA 0 August 30th, 2010 04:06 PM
Calling procedures in other worksheets pakman Excel VBA 2 July 20th, 2005 08:28 AM
Calling AS/400 Stored Procedures from VB.NET prasanthknair ADO.NET 0 January 19th, 2005 06:55 AM
Calling Oracle Stored Procedures booksnore2 General .NET 0 August 24th, 2004 02:08 PM
Calling Stored procedures with out parameters bansalh Access 1 November 25th, 2003 04:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.