Dot Net 2.0 ObjectDataSource

I'm beginning a new project for event registration in imis 10.6 and would like to know if anyone has experience with the new ObjectDataSource in .net 2.0. If not, do we have any C# code that is used for event registration. Any bugs or gotcha's?

Thanks in advance for your help.
Tom

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

It has been a while since

It has been a while since I've used an Object Data Source, but if I remember correctly, it is pretty simple. It basically allows easy data access to a collection of objects (aka classes). These can be user defined classes or standard .NET classes. The object data source is most often used in conjunction with a web service. Web services generally return sets of classes and with the object data source, you can do easy data binding with the web service.

Neil

objectDataSource

I was able to connect the ObjectDataSource to one of the asi.ibo members and it's methods. I then connected a gridview to the ObjectDataSource and I can see all of the fields exposed by the class. However, I don't see how to connect it to my sqlConnection. Can you help?

Tom

The ObjectDataSource is just

The ObjectDataSource is just like a SqlDataSource, except that it gets its data from a function call rather than a Sql call. What are you trying to do?

ObjectDataSource

I'm trying to get a list of events from the "Asi.iBO.Events.CEvent" class using the "GetAllEvents" method. I'm trying to pull the output using GridView. The gridview code shows all the fields, but I get an error. "Object reference not set to an instance of an object.
"

You don't need an object

You don't need an object data source. You can just bind the return value of GetAllEvents to the gridview.

Gridview.datasource = CEvent.GetAllEvent();

Then in your page, just set the data fields to the different properties of CEvent.

Asi.ibo.dll

Where does the class Asi.iBO.Events.CEvent get it's connection string to our sql server?

From your app.config or

From your app.config or web.config file; you need a connectionString entry named DataSource.iMIS.Connection, of the following format:
<connectionStrings>
<add name="DataSource.iMIS.Connection" connectionString="Data Source=[servername];User ID=[user];Password=[password];Initial Catalog=[databasename]"/>
</connectionStrings>

Connect Sting

Thank you Eric, Should persist security be part of the srting?

Tom

As far as I know, it does

As far as I know, it does not need to be.

login error

When attempting to login using:
"user = CContactUser.LoginByWebLogin(LoginId.Text, Password.Text);

or

user = CContactUser.LoginByContactId(LoginId.Text, Password.Text);

I get this error:
Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Have not seen this one before.
Also, do I need the "iBONameService" when using ibo for .net?

Tom