safedatareader

safedatareader

Old forum URL: forums.lhotka.net/forums/t/675.aspx


yh_ink posted on Wednesday, July 19, 2006

hey guys,

How do i call a safe datareader which is in my collection class directly from my webform.Is it Possible???

Michael Hildner replied on Wednesday, July 19, 2006

Hi yh_ink,

I don't think you'd want to do that. If you try to read data directly from the database from your form, you'd be missing out on the whole seperation of layers business. Your form should use your business objects, and let the business objects handle reading the data.

Why do you want to use the reader directly in your form? Maybe if you give a scenerio, you could get some options.

Regards,

Mike

yh_ink replied on Wednesday, July 19, 2006

hi mike

If i have a get method with datareader in my collection.how can i use that from my form.because it has to be passed with dr.What should be passed in that case.

please let me know

thanks

Michael Hildner replied on Wednesday, July 19, 2006

yh_ink,

I want to make sure I'm clear. You have a public get method in your business object that takes a datareader as a parameter?

Mike

malloc1024 replied on Wednesday, July 19, 2006

You do not want to pass datareaders around.  If you want to pass data to your UI use a collection, custom collection, array of structs or a datatable.  Whatever you do, do not pass datareaders to the presentation layer.

yh_ink replied on Wednesday, July 19, 2006

Thanks a lot guys....i just want to know how to do that.just curious to know about it....please put some code if there is a way...

ajj3085 replied on Thursday, July 20, 2006

Your UI shouldn't ever see ANY Ado.Net objects; if you do so, it defeats the purpose of using Csla at all.

Copyright (c) Marimer LLC