Click here to Skip to main content
15,912,507 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Javascript does not work on asp.net 2 page Pin
Guffa28-Jul-06 22:10
Guffa28-Jul-06 22:10 
QuestionGeneric query database and sort out returned DataSet? Pin
toptone7828-Jul-06 9:43
toptone7828-Jul-06 9:43 
AnswerRe: Generic query database and sort out returned DataSet? Pin
Ista28-Jul-06 9:57
Ista28-Jul-06 9:57 
GeneralRe: Generic query database and sort out returned DataSet? Pin
toptone7828-Jul-06 11:31
toptone7828-Jul-06 11:31 
GeneralRe: Generic query database and sort out returned DataSet? Pin
Ista28-Jul-06 18:41
Ista28-Jul-06 18:41 
GeneralRe: Generic query database and sort out returned DataSet? Pin
toptone7829-Jul-06 5:22
toptone7829-Jul-06 5:22 
GeneralRe: Generic query database and sort out returned DataSet? Pin
Ista29-Jul-06 7:11
Ista29-Jul-06 7:11 
GeneralRe: Generic query database and sort out returned DataSet? Pin
Ista29-Jul-06 7:24
Ista29-Jul-06 7:24 
and by the way. What I was talking about is loading a database record into a class from a generic base class.

So you'd create

public class GenericClass
{
public virtual void Load();
public virtual void Update();
}

Inside update you would test to see if the class has an id. If it does then this is not a new class otherwise it is.

I usually make my stored procs do update and inserts inside the same proc for less code to keep up with.

if constructor looks like so

public GenericClass( int id ) ** assuming the class uses an int id(indentity field)
{
Load(id);
}

this way all classes pass in an id to create

from your program
Player p = new Player(1); <-- has an id of 1

so when you run this code. It processes the PlayerClass Contructor for custom stuff first. then calls the Generic contructor with the ID. The Generic class then load the data into the class

By the way the PlayerClass construction should look somthing like
public PlayerClass( int id ) : ( id ) {}

the second will call the base class's constructor with the id

Thats the basics of it. If thats the path your going, I can help you with the code inside Save and Load. But you need to understand what this accomplishes from a high level. And of course, if this is what your trying to do.

Nick

--------------------------------------------------------

1 line of code equals many bugs. So don't write any!!

My mad coder blog

GeneralRe: Generic query database and sort out returned DataSet? Pin
toptone7829-Jul-06 8:50
toptone7829-Jul-06 8:50 
GeneralRe: Generic query database and sort out returned DataSet? Pin
toptone7829-Jul-06 12:11
toptone7829-Jul-06 12:11 
GeneralRe: Generic query database and sort out returned DataSet? Pin
Ista29-Jul-06 15:41
Ista29-Jul-06 15:41 
GeneralRe: Generic query database and sort out returned DataSet? Pin
toptone7830-Jul-06 0:25
toptone7830-Jul-06 0:25 
GeneralRe: Generic query database and sort out returned DataSet? [modified] Pin
Ista31-Jul-06 4:48
Ista31-Jul-06 4:48 
GeneralRe: Generic query database and sort out returned DataSet? Pin
toptone781-Aug-06 4:53
toptone781-Aug-06 4:53 
QuestionWant no postback on imagebutton click Pin
Vijaykumar Rajaram28-Jul-06 7:34
Vijaykumar Rajaram28-Jul-06 7:34 
AnswerRe: Want no postback on imagebutton click Pin
Ista28-Jul-06 8:44
Ista28-Jul-06 8:44 
AnswerRe: Want no postback on imagebutton click Pin
eggsovereasy28-Jul-06 8:51
eggsovereasy28-Jul-06 8:51 
QuestionAccess denied - urgent Pin
dansoft28-Jul-06 6:58
dansoft28-Jul-06 6:58 
AnswerRe: Access denied - urgent Pin
ToddHileHoffer28-Jul-06 7:03
ToddHileHoffer28-Jul-06 7:03 
GeneralRe: Access denied - urgent Pin
dansoft28-Jul-06 7:16
dansoft28-Jul-06 7:16 
GeneralRe: Access denied - urgent [modified] Pin
ToddHileHoffer28-Jul-06 7:27
ToddHileHoffer28-Jul-06 7:27 
GeneralRe: Access denied - urgent Pin
dansoft28-Jul-06 7:29
dansoft28-Jul-06 7:29 
GeneralRe: Access denied - urgent Pin
ToddHileHoffer28-Jul-06 7:35
ToddHileHoffer28-Jul-06 7:35 
GeneralRe: Access denied - urgent Pin
dansoft28-Jul-06 7:40
dansoft28-Jul-06 7:40 
GeneralRe: Access denied - urgent Pin
dansoft28-Jul-06 8:19
dansoft28-Jul-06 8:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.