Temporary "cursor"


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Hugo,

I am glad you've seen some light at the end of the tunnel.Smile

I thinked that couldn't access vfp stored procedures from .net , in fact I never used a custom vfp stored procedure)

Well, I have never used a SP at all, but sounded like SP would be a choice here and I am happy you where able to think about it and find some used for them. Tongue

Now it is working like a charm. With vfp stored procedures I think I have resolved most of my "problems"  Cool

Guess now I know where to go if I need to use SP in VFP Hehe

It is all about share, problems and solutions!!!!

Edhy Rijo

Hugo R. Figueroa
Hugo R. Figueroa
StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 3.1K
Edhy, I implemented what you suggested about stored procedures, (I thinked that couldn't access vfp stored procedures from .net , in fact I never used a custom vfp stored procedure :w00tSmile .

Now it is working like a charm. With vfp stored procedures I think I have resolved most of my "problems"  Cool

Thank you

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Thanks for your comments, Hugo.  I agree with you...we are very fortunate to have a lot of solid developers out here that participate for the benefit of all who visit versus just trying to, "show how smart they are." 
Hugo R. Figueroa
Hugo R. Figueroa
StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 3.1K
Thank you so much for your explanations (both Edhy and Trent). I think now I can go on.

This is one of the best forums (if not the best  Wink ).

You people know a lot of .net, but instead of try to impress others with your knowledge as occurs in many other .net forums, you make others really learn. And that is something I really appreciate.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Thanks for your comments, Edhy!  And I am really glad that you have enjoyed the new and improved ListView!!! Smile
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,

Thanks for your comments about LINQ, and mostly thanks for the "How to" in getting the data from another BO with the filter trick. 

The more I work with SF and try to understand the power in their BO logic, the more I get amazed of how simple the solution to a task is with SF, still the ListView is still my favorite control Hehe.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
First of all, thanks for your comments Edhy...all good stuff.  But I would really caution you from using LINQ...it is a nice concept, but the larger your database gets and your codebase becomes things can become very sluggish.  Even on an empty database, LINQ is significantly slower than straight T-SQL.  The problem is that when playing around with LINQ and creating a couple of queries, you don't notice it all that much...but the more code built with LINQ and the more complex queries become, then it really starts to show it's poor performance.  But to each his own, I just thought I would caution you against using LINQ.  At present, it is totally impossible for LINQ to perform as fast as straight T-SQL.

OK...so now back to the question.  You can either apply a filter on the BO that you bring in or call the Select() on the CurrentDataTable then pass the filtered BO into another BO via the CopyDataFrom method.

MyBO.CurrentDataTable.Select("MyField = 1234")

OR

MyBo.Filter = "MyField = 1234"
MySecondBO.CopyDataFrom(MyBO, ClearAndFillFromDefaultView)

Hugo R. Figueroa
Hugo R. Figueroa
StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 3.1K
Hi, Edhy

The problem is I am  providing web access of an application working with DBFs, not SQL server. I know I would be better using SQL server, but that will be the second step, ahead in the future. For now I have to work with VFP tables. I was thinking of Linq, but it seems hard for now .

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Hugo,

I understand that you want to do do 2 SELECTs and the 2nd one will be against the result of the first one.

I think that for what you need, you will be better off using a SP, this way you run all the SQL you need and the last one will be returned to the BO.

Or maybe you could use LINQ to query the data in the 1st BO, but I think that may be more hard to do if you are not familiar with LINQ.

The StrataFlix sample application have some SP sample that may help you get started.

Edhy Rijo

Hugo R. Figueroa
Hugo R. Figueroa
StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)StrataFrame User (163 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 3.1K
Thank you Trent for your answer (It is very helpfull to have code examples besides the explanations :coolSmile. Really.

The thing that I don't know how to accomplish is after selecting into a BO the data , how can I "select" from that BO (to group the data or change the field names)  into another BO ?

I feel dumb asking this questions, but if I don't ask , how can I learn?Hehe

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