Typed dataset

  • Thread starter Thread starter Trond
  • Start date Start date
T

Trond

I have a class MessageController that has a method GetMessagesDataset that
connects to a database SPROC. When done it returns a dataset.

Then in my ASP.NET for i do this:

msgController = new MessagesController();

DataSet dsMessages = new Dataset();

dsMessages = msgController.GetMessagesDataset();

dgMessages.DataSource=dsMessages;

DataBind();

As you se i am binding datagrid dgMessages to the dataset and voila i hava a
datagrid with data. Then i am starting to think that it would be nice to
format the datagrid using the wizard.

So i need to create a typed dataset. I can then use the typed dataset as
datasource and format my grid. But i do not get any data in the grid then.
So i am thinking maybe i should fill an object based on the typed dataset
and i am lost. How can i solve this?

Best regards
Trond
 
Hi, Trond!

I'm not sure if I get this correctly, but if you have created a schema with
generated typed dataset with Visual Studio, you should be able to drag a
DataSet component to your form. When you do this you get to choose if it
should represent one of your typed datasets. If you select one, you can set
the datasource of the datagrid with the property editor in the designer. In
addition you have to choose which DataMember to display (table). Now you can
right-click your grid, choose property designer and start formatting based
on the schema.

Hope this helps. :)
Lars-Erik
 
Back
Top