Feature requests for dOOdads

All your dOOdad needs ...

Feature requests for dOOdads

Postby Peter Welzien on Fri Aug 27, 2004 7:34 am

Hi!

I have some feature requests:

- ConnectionString is virtual and can be overridden but all the functions uses the internal _raw variable, wouldn't it be better to let them use the virtual property as well? As for the other properties as well.
- Let LoadFromSqlNoExec() return the integer value from ExecuteNonQuery()
- Can you add a LoadFromSqlScalar() function?
- Add a Validate() or modify the Save() function to make it call a virtual \"bool ValidateRow(DataRow, RowState)\" function and abort the save through a exception/return value if it returns false.

Thanks for a great app, it has really saved my butt! :D


Best regards,

Peter Welzien
real programmers use:
copy con: program.exe
Peter Welzien
Lurker
 
Posts: 7
Joined: Sat Apr 03, 2004 6:10 am
Location: Stockholm, Sweden

Postby mike.griffin on Fri Aug 27, 2004 2:26 pm

Awesome suggestion, I will incorporate as many as these as I can as long as they don't break any backwards compatibility rules.

Thanx !!
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Postby mike.griffin on Sun Aug 29, 2004 11:53 pm

Next build of course, but here is the status of your request:

DONE: LoadFromSqlNoExec returns value from ExecuteNonQuery
DONE: Implement LoadFromSqlScalar()

Already available:
modify the Save() function to make it call a virtual \"bool ValidateRow(DataRow, RowState)\"

Look in the OleDbEntity class of the dOOdad DbAdapters folder at a function named HookupRowUpdateEvents, it is the best example for this. It traps the OnRowUpdated to fetch back the identity column for Access databases but shows you how to use those events.

There are two methods you can can trap on the DataAdpater, RowUpdating and RowUpdated.

On your connection string request I'm a little confused? What exactly is it that you're trying to accomplish?
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Postby mthird on Mon Aug 30, 2004 2:10 am

Code: Select all
CREATE PROCEDURE \"PI_AGENCY\"
(
    \"I$AGENCYID\" BIGINT,
    \"I$AGENCYNAME\" VARCHAR(60),
    \"I$AGENCYCODE\" CHAR(10),
    \"I$PHONE1\" CHAR(20),
    \"I$PHONE2\" CHAR(20),
    \"I$FAX\" CHAR(20),
    \"I$WEBSITE\" VARCHAR(120),
    \"I$PRIMARYCONTACT\" VARCHAR(60),
    \"I$ADDRESSID\" BIGINT,
    \"I$CREATEDTIMESTAMP\" TIMESTAMP,
    \"I$CREATEDBYUSERID\" BIGINT,
    \"I$LASTCHANGEDTIMESTAMP\" TIMESTAMP,
    \"I$LASTCHANGEDBYUSERID\" BIGINT,
    \"I$OPTIONS\" BLOB
)
RETURNS
(
    \"AGENCYID\" BIGINT
)

AS
BEGIN

    \"I$AGENCYID\" = GEN_ID(\"KEYGENERATOR\", 1);

    INSERT INTO \"AGENCY\"
    (
        \"AGENCYID\",
        \"AGENCYNAME\",
        \"AGENCYCODE\",
        \"PHONE1\",
        \"PHONE2\",
        \"FAX\",
        \"WEBSITE\",
        \"PRIMARYCONTACT\",
        \"ADDRESSID\",
        \"CREATEDTIMESTAMP\",
        \"CREATEDBYUSERID\",
        \"LASTCHANGEDTIMESTAMP\",
        \"LASTCHANGEDBYUSERID\",
        \"OPTIONS\"
    )
    VALUES
    (
        :\"I$AgencyId\",
        :\"I$AgencyName\",
        :\"I$AgencyCode\",
        :\"I$Phone1\",
        :\"I$Phone2\",
        :\"I$Fax\",
        :\"I$Website\",
        :\"I$PrimaryContact\",
        :\"I$AddressId\",
        :\"I$CreatedTimestamp\",
        :\"I$CreatedByUserId\",
        :\"I$LastChangedTimestamp\",
        :\"I$LastChangedByUserId\",
        :\"I$OPTIONS\"
    );

    \"AGENCYID\" = :\"I$AGENCYID\";

END
mthird
Lurker
 
Posts: 1
Joined: Mon Aug 09, 2004 2:37 am

Postby Peter Welzien on Mon Aug 30, 2004 8:04 am

Well Mike,

I'm trying to actually override where dOOdads is retrieving it's connection string. I'm trying to make it read it from a dynamic source so I can't use the config file and I don't really want to pass any parameters to the constructor.

This is what I want to do:

public override string ConnectionString
{
get
{
return MyObject.ConnectionString;
}
}

No real problem as I can set it in the constructor but as far as I see it - making the properties virtual don't make any sense.

/ PW
real programmers use:
copy con: program.exe
Peter Welzien
Lurker
 
Posts: 7
Joined: Sat Apr 03, 2004 6:10 am
Location: Stockholm, Sweden

Postby Peter Welzien on Mon Aug 30, 2004 8:18 am

There is one more thing I'm missing!

I need to be able to create parameters to call stored procedures, could you add that as well?

Best regards,

Peter Welzien
real programmers use:
copy con: program.exe
Peter Welzien
Lurker
 
Posts: 7
Joined: Sat Apr 03, 2004 6:10 am
Location: Stockholm, Sweden

Postby mike.griffin on Mon Aug 30, 2004 2:16 pm

I need to be able to create parameters to call stored procedures, could you add that as well?


There is a template in the C# dOOdads template area that can do that, do you need to do it a runtime or at compile time, if compile time then we can help there.
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Postby Peter Welzien on Mon Aug 30, 2004 10:58 pm

Oops, didn't think of that... :oops:

Anyway, a big thanks for the help with the stored procedure handling!!!

/ P W
real programmers use:
copy con: program.exe
Peter Welzien
Lurker
 
Posts: 7
Joined: Sat Apr 03, 2004 6:10 am
Location: Stockholm, Sweden


Return to dOOdads - MyGeneration's .NET Architecture

Who is online

Users browsing this forum: No registered users and 0 guests

cron