SF BO throws DataAccessLayerException when Accessed any method of the BusinessObject.


SF BO throws DataAccessLayerException when Accessed any method of the...
Author
Message
Vikram Saxena
Vikram Saxena
StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)
Group: Forum Members
Posts: 41, Visits: 99
Dear All,

i am using Starta Frame on my machine. everything is running quite well on machine. Our one more developer is also working on the same project as i am. but when he started the project on his machine a DataAccessLayer Exception is being thrown on his machine with the message that "An error occurred whuke creating a new DataLayer for the Business object." The inner exception is null. The other information i found for exception is "DataSourceKey [] is not defined."

please tell me whats the wrong happening here?

my code is in C# and SetDataSource event handler for the StartaFrame.SetDataSource event is as follows (present in program.cs)

static void StrataFrameApplication_SetDataSources()

{

ConnectionManager.ApplicationKey = "ISOCOM Key";

ConnectionManager.ApplicationDefaultTitle = "ISOCOM Connection";

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

// Set the required data source information so that the ConnectionManager can gather it

// SQL Connection

ConnectionManager.AddRequiredDataSourceItem("ISOCOM Key", "SQL Connection", DataSourceTypeOptions.SqlServer, "ISOCOM", "This connection is used by MyApplication.", true);

////SQL Connection

//// Make the call to SetConnections which will gather the connection information, show the connection wizard

//// if needed and set the DataSources collection on the DataLayer class.

ConnectionManager.SetConnections();

}


Replies
Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
3) Yes, the manual option allows you to retrieve the connection string any way you want to. You don't have to use the ConnectionManager class at all. (especially the ConnectionManager.SetConnections() method [Wink] ).



I especially not call this method as you say and all work ok (I was thinked that this line cannot have to be supressed Hehe )





4) Yes, the field must belong to the CurrentDataTable to be able to filter on it. So, if you add an additional column to the CurrentDataTable and populate that column, you'll be able to filter/sort on it. But, if you just have a custom field that does not have a backing column in the CurrentDataTable, you will not be able to sort/filter on it.



I don´t watched that I don´t need to use Currentview.table w00t

I called my "_ExtraColumnAdd" method after the fill method and voila! BigGrin





Private Sub _ExtraColumnAdd()



'Me.CurrentView.Table.Columns.Add("ExtraColumnName", System.Type.GetType("System.String"), "")

Me.CurrentDataTable.Columns.Add("ExtraColumnName", System.Type.GetType("System.String"), "")



Dim row As DataRow

'For Each row In Me.CurrentView.Table.Rows

For Each row In Me.CurrentDataTable.Rows

'Some stuff to fill the new column here

row("ExtraColumnName") = "Voila!"

Next row

End Sub





later on my form I can use this column like another



It´s the best thing to do about add a new calculated field that can be filtered?




Thanks Ben and Trent for all the support to learn all the stuff around Strataframe, you are awesome Smile








pd: Can I post a sample with a routine that recursively read a DB to fill a treeview on the contribution topic to read some feedback on what is wrong and what can I do in a better manner?



its used to create a tree menu like

1 : Module 1

1.1: ABMs

1.1.1: Customers

1.1.2: Employees / etc)

1.2: Configs


StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
I'm glad you got that working.  Smile

As for the calculated fields, we just implemented logic that allows you to use a calculated field with the AllowNullValuesOnNewRow = False (default) because the row tries to initialize the value and it cannot because it is readonly.  So, if you want to use a calculated field, and you get an error saying that you cannot update a readonly field in the InitializeRow() method, then let me know and I'll post the corrected DLLs for you.

Can I post a sample with a routine that recursively read a DB to fill a treeview on the contribution topic to read some feedback on what is wrong and what can I do in a better manner?

Sure thing Smile  We have the General .NET Discussion forum for just that sort of thing. (http://forum.strataframe.net/Forum14-1.aspx).  You can post anything in there and lots of people will be happy to help you out with it.

Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)StrataFrame User (317 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Ben, thanks for all the feedback and support, I´m a newbie on .net and I think that Strataframe is the better way of go away from vfp and stay on the road of new technology close to .net.



Two days ago my boss buy the framework for me (I convinced him after four weeks of initial tests and learning) and I have thousand of questions, doubts (and a little of fear) but I happy with all of those because I sure that I choose the correct tool to make the fast as posible the application that he request to me with the great and awesome support that you bring to me and all the comunity on this forum Smile



I have to learn a lot about .net while learning the framework and I try to not disturb you and Trent so much in this path Smile



Thanks Again



- Fabian

[I learn I learn I learn]

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
We'll you'll never learn unless you're shown or you ask questions.  So, keep asking the questions and we'll keep doing our best to answer them.  We don't know everything about .NET, but if we don't know it, we might have a better idea on what to type in your google search to find it and maybe point you in the right direction.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Vikram Saxena - 19 Years Ago
StrataFrame Team - 19 Years Ago
Fabian R Silva, - - 18 Years Ago
             StakTrace:

en...
Fabian R Silva, - - 18 Years Ago
StrataFrame Team - 18 Years Ago
                     Hello, thanks for reply

I tested everything....except set 1...
Fabian R Silva, - - 18 Years Ago
                         about question #4 the post...
Fabian R Silva, - - 18 Years Ago
                         Forgive about the popup that appears when I run the project, I forgive...
Fabian R Silva, - - 18 Years Ago
                             1) A data source with a DataSourceKey of "" is not required, but...
StrataFrame Team - 18 Years Ago
                                 3) Yes, the manual option allows you to retrieve the connection string...
Fabian R Silva, - - 18 Years Ago
                                     I'm glad you got that working. :) As for the calculated fields, we...
StrataFrame Team - 18 Years Ago
                                         Ben, thanks for all the feedback and support, I´m a newbie on .net and...
Fabian R Silva, - - 18 Years Ago
                                             We'll you'll never learn unless you're shown or you ask questions. So,...
StrataFrame Team - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search