View Single Post
Old Apr 27th, 2005, 11:38 PM   #5
new User(Kevin.Parkinson)
Programmer
 
new User(Kevin.Parkinson)'s Avatar
 
Join Date: Mar 2005
Location: Edmonton, Alberta, Canada
Posts: 37
Rep Power: 0 new User(Kevin.Parkinson) is on a distinguished road
Send a message via MSN to new User(Kevin.Parkinson)
Arla:
I think there are a few ways do accomplish what you are trying to do. Personally I would not go with a different C# method/procedure for each different case. I would however consider some other points:
  • create a person class with all those fields, so that your method will look like this: public void StorePerson( Person p ); instead of multiple methods with many params.
  • have optional( NULL ) fields within your database.
  • have one generic stored procedure that can take care of everything
  • perhaps use text/non-stored procedure based SQL statements( assuming you apply the notion of optional fields in the database ) and then you can insert fields as you wish.


..as well, if you are getting the Person information from a form, you can take that information and insert it right into your SQL statement( provided you have checked that information for validity & security ).


Please correct me if I am not getting what you need to do. I do like these kinds of problems though. They are the meat of programming - how can I make this or that happen in the most efficient and interesting way? Again, it would be nice, if its possible for you to post some code, so we get a better idea of what you are trying to accomplish.

Right now, I am actually working on an ASP.NET application in C# that will help me organise inofmation, take notes, track grades, print reports, etc... for me in my collge program at NAIT here in Edmonton, Alberta, Canada. Its a lot of fun!
__________________
public class  MySignature extends Post implements JavaSyntax throws NuttinHoney{
     MySignature()
     {
          Salutation();
          Name();
     }
     
     public string  Salutation()
     {
          Screen.printLn( "Sincerely,\n" );
     }
     
     public string  Name()
     {
          Screen.printLn( "Kevin Parkinson" );
     }
}

Last edited by new User(Kevin.Parkinson); Apr 27th, 2005 at 11:41 PM.
new User(Kevin.Parkinson) is offline   Reply With Quote