Typed dataset

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
 
L

Lars-Erik Aabech

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top