Add a new table/row programmatically


Author
Message
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.

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().

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()

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
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
mydebug.html is empty.

Not possible if you have the correct data source mapped.  This is not accessible until you close down your application.  You have something wired improperly it sounds like....there are at least a dozen or more things that could be going on...all of which point to something related to your data connection.  How are you setting up your data connection?

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
Nobody on this world can ever say that you're not patient Smile

I did nothing unusual when I set up my data connection:

private static void SetDataSources()

{

// The application key:

ConnectionManager.ApplicationKey = "ChangeThisValue";

ConnectionManager.ApplicationDefaultTitle = "EKZ7 Connection";

ConnectionManager.ApplicationDefaultDescription = "This application connection is used by EKZ7";

// SQL Connection

ConnectionManager.AddRequiredDataSourceItem("", "SQL Connection",

DataSourceTypeOptions.SqlServer, "EKZ7", "This connection is used by EKZ7.");

ConnectionManager.SetConnections();

MicroFour.StrataFrame.Data.DataBasics.DataSources[0].SetDebugOn(@"c:\temp\myDebug.html", true);

}


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
This looks OK....did you try to Save() your changes with this code in place?  Nothing is written to this file until a SELECT, DELETE, UPDATE, or INSERT is called.
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
Yes, I use this lines of code since I work on this project and I'm quite sure that it works pretty well because it works well in lots of other parts of my app.

It really seems as if the Save() method would simply do nothing. All the data is in the CurrentDataTable() and Save() does absolutely nothing. It even does not change it's own status "Success". If I work with another part of my application, the myDebug.html file gets content. It's JUST in this point of my app.

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
This would explain all of your other problems.  Do you have anything in the DataSourceKey property?  There is something related to this BO that is not executing the Save().  Since nothing shows up in this file, this tells us that it is not trying to use this data source connection.
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