How to populate Dataset schema using stored procs?

P

Paul R

Hi, I am changing my data access layer to use stored procedures instead of
direct SQL commands. I am using untyped DataSets.

When wanting to use a form to, say, add new customer details, I previously
created an empty Dataset to use for the new customer details by calling my
Customer data access layer with a non-existent Customer ID, thus:

myNewDataSet = CustomerDataAccess.GetCustomer(-1);

This gave me an empty DataSet but which had the schema populated, so I could
call NewRow() etc and then Update() to update the database.

However, if I change the CustomerDataAccess.GetCustomer method to use a
stored procedure I get an empty DataSet with no tables or schema.

Is there any easy way to populate a schema with stored procs, or am I doing
something completely wrong?

Thanks!

Paul
 
S

Stephen Muecke

Paul,
Creating a separate DataSet (DataTable?) to create the new row seems a
rather odd way of doing this. Why not just use a new row in the existing
DataTable?
Stephen
 

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

Top