Add a new table/row programmatically


Author
Message
Gerhard Jaros
Gerhard Jaros
StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)
Group: Forum Members
Posts: 18, Visits: 22
Trent L. Taylor (10/30/2006)
Then you need to either put a debug on your data connection in the program.cs file at the bottom of the SetDataSources() method:

MicroFour.StrataFrame.Data.Databasics.DataSources(0).SetDebugOn("c:\\temp\\mydebug.html",True);.

mydebug.html is empty.

or you need to capture the ErrorSaving event of the BO and look at the event args to see if you are getting an error. 

I cannot understand what you mean with "capture the errorSaving event"

Last, what does the Save() method return as a result.  You can use all of these to figure out where your problem is.

Save returns "Success"

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Then you need to either put a debug on your data connection in the program.cs file at the bottom of the SetDataSources() method:

MicroFour.StrataFrame.Data.Databasics.DataSources(0).SetDebugOn("c:\\temp\\mydebug.html",True);

or you need to capture the ErrorSaving event of the BO and look at the event args to see if you are getting an error. 

Last, what does the Save() method return as a result.  You can use all of these to figure out where your problem is.

Gerhard Jaros
Gerhard Jaros
StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)
Group: Forum Members
Posts: 18, Visits: 22
Smile

this.CurrentDataTable is empty before I run CopyDataTable() and it contains all my data after CopyDataTable()

Gerhard Jaros
Gerhard Jaros
StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)
Group: Forum Members
Posts: 18, Visits: 22
Smile

this.CurrentDataTable is empty before I run CopyDataFrom and it contains all my data after CopyDataFrom().

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Where can I find the source code of CopyDataFrom() in the Source Code Directory?

This will be in the BusinessLayer class found in the MicroFour StrataFrame Business project when you open the source solution.

If this would be an SQL error, where could I find the SQL error message

I think your problem is happening before you ever get here.  You need to look at the data table in the debugger to see if the data gets copied over before you call the save command.

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
There is not a lot of rocket-science in this method BigGrin  If you debug this code and look at it in the watch window (your data table and the BO.CurrentDataTable) before and after the CopyDataFrom method, do you not see the records?
Gerhard Jaros
Gerhard Jaros
StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)
Group: Forum Members
Posts: 18, Visits: 22
There are two things which could maybe help me:

1. Where can I find the source code of CopyDataFrom() in the Source Code Directory?
2. If this would be an SQL error, where could I find the SQL error message?

Gerhard Jaros
Gerhard Jaros
StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)
Group: Forum Members
Posts: 18, Visits: 22
The structure is exactly the same
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Do you have the same structure in the data table that is populated within the BO?  If you have called a Fill() command or popualted the BO and then load a data table that does not have the same structure, you are going to have some trouble.
Gerhard Jaros
Gerhard Jaros
StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)
Group: Forum Members
Posts: 18, Visits: 22
Sorry, it doesn't append 11 empty rows, it appends nothing.

...gerhard...

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search